Part Number Hot Search : 
5248B PM5349 DSP16 1N5618 80C32 RF201 EBE51 BST60
Product Description
Full Text Search
 

To Download MC68HC912D60 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  www.motorola.com/semiconductors m68hc12 microcontrollers MC68HC912D60/d rev. 3, 7/2002 mc68hc(9)12d60 advance information

68hc(9)12d60 ? rev 3.0 motorola 3 68hc912d60 advance information ? rev 3.0 motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be validated for each customer application by customer?s technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola, inc. is an equal opportunity/affirmative action employer. motorola and are registered trademarks of motorola, inc. digitaldna is a trademark of motorola, inc. ? motorola, inc., 2002
68hc(9)12d60 ? rev 3.0 4 motorola
68hc(9)12d60 ? rev 3.0 advance information motorola list of paragraphs 5 advance information ? 68hc(9)12d60 list of paragraphs list of paragraphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 list of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 list of figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 section 1. general description . . . . . . . . . . . . . . . . . . . . 23 section 2. central processing unit . . . . . . . . . . . . . . . . . 31 section 3. pinout and signal descriptions . . . . . . . . . . . 37 section 4. registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 section 5. operating modes and resource mapping . . 73 section 6. bus control and input/output . . . . . . . . . . . . 87 section 7. flash memory . . . . . . . . . . . . . . . . . . . . . . . . . 99 section 8. eeprom memory . . . . . . . . . . . . . . . . . . . . . 115 section 9. resets and interrupts . . . . . . . . . . . . . . . . . . 123 section 10. rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 section 11. i/o ports with key wake-up . . . . . . . . . . . . 135 section 12. clock functions . . . . . . . . . . . . . . . . . . . . . 143 section 13. pulse width modulator . . . . . . . . . . . . . . . 181 section 14. enhanced capture timer. . . . . . . . . . . . . . 197 section 15. multiple serial interface . . . . . . . . . . . . . . . 237 section 16. motorola interconnect bus . . . . . . . . . . . . 263
list of paragraphs advance information 68hc(9)12d60 ? rev 3.0 6 list of paragraphs motorola section 17. mscan controller . . . . . . . . . . . . . . . . . . . 277 section 18. analog-to-digital converter . . . . . . . . . . . 323 section 19. development support . . . . . . . . . . . . . . . . 337 section 20. electrical specifications . . . . . . . . . . . . . . 365 section 21. appendix: cgm practical aspects . . . . . . 387 section 22. appendix: 68hc912d60a flash eeprom399 section 23. appendix: 68hc912d60a eeprom . . . . . 407 glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
68hc(9)12d60 ? rev 3.0 advance information motorola table of contents 7 advance information ? 68hc(9)12d60 table of contents list of paragraphs table of contents list of tables list of figures section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.4 ordering information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.5 68hc(9)12d60 block diagrams . . . . . . . . . . . . . . . . . . . . . . . . 29 section 2. central processing unit 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.3 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.4 data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.5 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 2.6 indexed addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . .35 2.7 opcodes and operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
table of contents advance information 68hc(9)12d60 ? rev 3.0 8 table of contents motorola section 3. pinout and signal descriptions 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.2 68hc(9)12d60 pin assignments in 112-pin qfp. . . . . . . . . . . 38 3.3 68hc(9)12d60 pin assignments in 80-pin qfp. . . . . . . . . . . . 40 3.4 power supply pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 3.5 signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.6 port signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 section 4. registers 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 4.2 register block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 section 5. operating modes and resource mapping 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 5.3 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 5.4 background debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 5.5 internal resource mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5.6 memory maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 section 6. bus control and input/output 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 6.3 detecting access type from external signals . . . . . . . . . . . . .87 6.4 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 section 7. flash memory 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
table of contents 68hc(9)12d60 ? rev 3.0 advance information motorola table of contents 9 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.3 overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 7.4 flash eeprom control block . . . . . . . . . . . . . . . . . . . . . . . . 100 7.5 flash eeprom arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 7.6 flash eeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.7 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 7.8 programming the flash eeprom . . . . . . . . . . . . . . . . . . . . . 108 7.9 erasing the flash eeprom . . . . . . . . . . . . . . . . . . . . . . . . . .111 7.10 program/erase protection interlocks . . . . . . . . . . . . . . . . . . .113 7.11 stop or wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 section 8. eeprom memory 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 8.3 future eeprom support . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 8.4 eeprom programmer ? s model . . . . . . . . . . . . . . . . . . . . . . . 117 8.5 eeprom control registers . . . . . . . . . . . . . . . . . . . . . . . . . . 118 section 9. resets and interrupts 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 9.3 maskable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 9.4 latching of interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 9.5 interrupt control and priority registers . . . . . . . . . . . . . . . . . 127 9.6 resets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 9.7 effects of reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 9.8 register stacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
table of contents advance information 68hc(9)12d60 ? rev 3.0 10 table of contents motorola 9.9 customer information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 section 10. rom 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.3 rom array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 section 11. i/o ports with key wake-up 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 11.3 key wake-up and port registers . . . . . . . . . . . . . . . . . . . . . .136 11.4 key wake-up input filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 section 12. clock functions 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 12.3 clock sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 12.4 phase-locked loop (pll) . . . . . . . . . . . . . . . . . . . . . . . . . . .145 12.5 acquisition and tracking modes. . . . . . . . . . . . . . . . . . . . . . .147 12.6 limp-home and fast stop recovery modes . . . . . . . . . . . . 149 12.7 system clock frequency formulas . . . . . . . . . . . . . . . . . . . . . 167 12.8 clock divider chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 12.9 computer operating properly (cop) . . . . . . . . . . . . . . . . . . .172 12.10 real-time interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 12.11 clock monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 12.12 clock function registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 section 13. pulse width modulator
table of contents 68hc(9)12d60 ? rev 3.0 advance information motorola table of contents 11 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 13.3 pwm register description . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 13.4 pwm boundary cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 section 14. enhanced capture timer 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 14.3 enhanced capture timer modes of operation . . . . . . . . . . . . 203 14.4 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 14.5 timer and modulus counter operation in different modes . .235 section 15. multiple serial interface 15.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 15.3 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 15.4 serial communication interface (sci) . . . . . . . . . . . . . . . . . . 238 15.5 serial peripheral interface (spi) . . . . . . . . . . . . . . . . . . . . . . . 250 15.6 port s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 section 16. motorola interconnect bus 16.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 16.3 push-pull sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 16.4 biphase coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265 16.5 message validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 16.6 interfacing to mi bus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268
table of contents advance information 68hc(9)12d60 ? rev 3.0 12 table of contents motorola 16.7 mi bus clock rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 16.8 sci0/mi bus registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 section 17. mscan controller 17.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 17.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 17.3 external pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 17.4 message storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279 17.5 identifier acceptance filter . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 17.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 17.7 protocol violation protection. . . . . . . . . . . . . . . . . . . . . . . . . . 289 17.8 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290 17.9 timer link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 17.10 clock system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 17.11 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 17.12 programmer ? s model of message storage . . . . . . . . . . . . . . .298 17.13 programmer ? s model of control registers . . . . . . . . . . . . . . . 303 section 18. analog-to-digital converter 18.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 18.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 18.4 atd registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 18.5 atd mode operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 section 19. development support 19.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
table of contents 68hc(9)12d60 ? rev 3.0 advance information motorola table of contents 13 19.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 19.3 instruction queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 19.4 background debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 19.5 breakpoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 19.6 instruction tagging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 section 20. electrical specifications 20.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 20.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 20.3 tables of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 section 21. appendix: cgm practical aspects 21.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 21.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 21.3 a few hints for the cgm crystal oscillator application. . . . 387 21.4 practical aspects for the pll usage . . . . . . . . . . . . . . . . . . 390 21.5 printed circuit board guidelines. . . . . . . . . . . . . . . . . . . . . . . 395 section 22. appendix: 68hc912d60a flash eeprom 22.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 22.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 22.3 overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 22.4 flash eeprom control block . . . . . . . . . . . . . . . . . . . . . . . . 400 22.5 flash eeprom arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 22.6 flash eeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 22.7 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .403 22.8 programming the flash eeprom . . . . . . . . . . . . . . . . . . . . . 404
table of contents advance information 68hc(9)12d60 ? rev 3.0 14 table of contents motorola 22.9 erasing the flash eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . 405 22.10 stop or wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .405 section 23. appendix: 68hc912d60a eeprom 23.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 23.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 23.3 eeprom programmer ? s model . . . . . . . . . . . . . . . . . . . . . . . 408 23.4 eeprom control registers . . . . . . . . . . . . . . . . . . . . . . . . . . 409 23.5 program/erase operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 23.6 shadow word mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . .415 23.7 programming eedivh and eedivl registers. . . . . . . . . . . . 416 glossary revision history 23.8 changes from rev 2.0 to rev 3.0 . . . . . . . . . . . . . . . . . . . . . 429 23.9 changes from rev 1.0 to rev 2.0 . . . . . . . . . . . . . . . . . . . . . 430
68hc(9)12d60 ? rev 3.0 advance information motorola list of tables 15 advance information ? 68hc(9)12d60 list of tables table title page 1-1 device ordering information. . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1-2 68hc(9)12d60 development tools ordering information . . . . 28 2-1 m68hc12 addressing mode summary . . . . . . . . . . . . . . . . . . 34 2-2 summary of indexed operations . . . . . . . . . . . . . . . . . . . . . . . 35 3-1 68hc(9)12d60 power and ground connection summary. . . .44 3-2 68hc(9)12d60 signal description summary . . . . . . . . . . . . . . 51 3-3 68hc(9)12d60 port description summary. . . . . . . . . . . . . . . .60 3-4 port pull-up, pull-down and reduced drive summary . . . . . .61 4-1 68hc(9)12d60 register map . . . . . . . . . . . . . . . . . . . . . . . . . . 64 5-1 mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 5-2 mapping precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 5-3 rfstr stretch bit definition . . . . . . . . . . . . . . . . . . . . . . . . . . 85 5-4 exstr stretch bit definition . . . . . . . . . . . . . . . . . . . . . . . . . . 85 7-1 effects of enpe, lat and eras on array reads . . . . . . . . .105 8-1 1k byte eeprom block protection . . . . . . . . . . . . . . . . . . . . 120 8-2 erase selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 9-1 interrupt vector map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 9-2 stacking order on entry to interrupts . . . . . . . . . . . . . . . . . . . 132 12-1 summary of stop mode exit conditions. . . . . . . . . . . . . . . . 161 12-2 summary of pseudo stop mode exit conditions . . . . . . . . . 161 12-3 clock monitor time-outs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 12-4 real time interrupt rates. . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 12-5 cop watchdog rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 13-1 clock a and clock b prescaler. . . . . . . . . . . . . . . . . . . . . . . . 186 13-2 pwm left-aligned boundary conditions . . . . . . . . . . . . . . . . 196 13-3 pwm center-aligned boundary conditions . . . . . . . . . . . . . . 196 14-1 compare result output action . . . . . . . . . . . . . . . . . . . . . . . . 212 14-2 edge detector circuit configuration . . . . . . . . . . . . . . . . . . . . 212 14-3 prescaler selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
list of tables advance information 68hc(9)12d60 ? rev 3.0 16 list of tables motorola 15-1 baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240 15-2 loop mode functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 15-3 ss output selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 15-4 spi clock rate selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 16-1 mi bus delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 17-1 mscan12 interrupt vectors . . . . . . . . . . . . . . . . . . . . . . . . . .289 17-2 mscan12 vscpu operating modes . . . . . . . . . . . . . . . . . . . . 291 17-3 can standard compliant bit time segment settings . . . . . . 297 17-4 data length codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 17-5 synchronization jump width . . . . . . . . . . . . . . . . . . . . . . . . . .307 17-6 baud rate prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 17-7 time segment syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 17-8 time segment values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 17-9 identifier acceptance mode settings . . . . . . . . . . . . . . . . . . .315 17-10 identifier acceptance hit indication . . . . . . . . . . . . . . . . . . . . 316 18-1 atd response to background debug enable . . . . . . . . . . . . 327 18-2 final sample time selection . . . . . . . . . . . . . . . . . . . . . . . . . 328 18-3 clock prescaler values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 18-4 multichannel mode result register assignment . . . . . . . . . . 331 19-1 ipipe decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 19-2 hardware commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 19-3 bdm firmware commands . . . . . . . . . . . . . . . . . . . . . . . . . .345 19-4 bdm registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 19-5 ttago decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 19-6 ttago value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 19-7 instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 19-8 regn decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 19-9 breakpoint mode control . . . . . . . . . . . . . . . . . . . . . . . . . . . .358 19-10 breakpoint address range control . . . . . . . . . . . . . . . . . . . . 359 19-11 breakpoint read/write control . . . . . . . . . . . . . . . . . . . . . . . .361 19-12 tag pin function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 20-1 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 20-2 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 20-3 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 368 20-4 supply current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 20-5 atd dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . 369 20-6 analog converter characteristics (operating) . . . . . . . . . . . .370 20-7 atd ac characteristics (operating). . . . . . . . . . . . . . . . . . . . 371
list of tables 68hc(9)12d60 ? rev 3.0 advance information motorola list of tables 17 20-8 atd maximum ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 20-9 eeprom characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 20-10 flash eeprom characteristics (68hc912d60 only). . . . . . . 372 20-11 pulse width modulator characteristics. . . . . . . . . . . . . . . . . . 374 20-12 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 20-13 peripheral port timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .380 20-14 multiplexed expansion bus timing. . . . . . . . . . . . . . . . . . . . . 381 20-15 spi timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 20-16 cgm characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 20-17 key wake-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 20-18 mscan12 wake-up time from sleep mode. . . . . . . . . . . . . . 386 21-1 suggested 8mhz synthesis pll filter elements (tracking mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 21-2 suggested 8mhz synthesis pll filter elements (acquisition mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .394 23-1 eediv selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410 23-2 2k byte eeprom block protection . . . . . . . . . . . . . . . . . . . . 412 23-3 erase selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .413 23-4 shadow word mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
list of tables advance information 68hc(9)12d60 ? rev 3.0 18 list of tables motorola
68hc(9)12d60 ? rev 3.0 advance information motorola list of figures 19 advance information ? 68hc(9)12d60 list of figures figure title page 1-1 68hc(9)12d60 112-pin qfp block diagram . . . . . . . . . . . . . . 29 1-2 68hc(9)12d60 80-pin qfp block diagram . . . . . . . . . . . . . . . 30 2-1 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 3-1 pin assignments in 112-pin tqfp for 68hc(9)12d60 . . . . . . . 38 3-2 112-pin tqfp mechanical dimensions (case no987) . . . . . . . 39 3-3 pin assignments in 80-pin qfp for 68hc(9)12d60 . . . . . . . . .40 3-4 80-pin qfp mechanical dimensions (case no841b) . . . . . . . .41 3-5 pll loop filter connections . . . . . . . . . . . . . . . . . . . . . . . . . .43 3-6 common crystal connections . . . . . . . . . . . . . . . . . . . . . . . . . 45 3-7 external oscillator connections . . . . . . . . . . . . . . . . . . . . . . . . 45 5-1 68hc(9)12d60 memory map . . . . . . . . . . . . . . . . . . . . . . . . . .86 6-1 access type vsbus control pins . . . . . . . . . . . . . . . . . . . . . . . 88 7-1 program sequence flow . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 7-2 erase sequence flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 11-1 stop key wake-up filter (falling edge trigger) timing. . . . . .141 12-1 internal clock relationships . . . . . . . . . . . . . . . . . . . . . . . . . . 145 12-2 pll functional diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146 12-3 clock loss during normal operation . . . . . . . . . . . . . . . . . . .150 12-4 no clock at power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . 152 12-5 stop exit and fast stop recovery . . . . . . . . . . . . . . . . . . . 155 12-6 clock generation chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 12-7 clock chain for sci0, sci1, rti, cop. . . . . . . . . . . . . . . . . . 170 12-8 clock chain for ect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 12-9 clock chain for mscan, spi, atd0, atd1 and bdm . . . . . . 172 13-1 block diagram of pwm left-aligned output channel . . . . . . 182 13-2 block diagram of pwm center-aligned output channel . . . . 183 13-3 pwm clock sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 14-1 timer block diagram in latch mode. . . . . . . . . . . . . . . . . . . . 199 14-2 timer block diagram in queue mode. . . . . . . . . . . . . . . . . . . 200
list of figures advance information 68hc(9)12d60 ? rev 3.0 20 list of figures motorola 14-3 8-bit pulse accumulators block diagram . . . . . . . . . . . . . . . . 201 14-4 16-bit pulse accumulators block diagram . . . . . . . . . . . . . . .202 14-5 block diagram for port7 with output compare / pulse accumulator a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 14-6 c3f-c0f interrupt flag setting . . . . . . . . . . . . . . . . . . . . . . . 203 15-1 multiple serial interface block diagram . . . . . . . . . . . . . . . . . 238 15-2 serial communications interface block diagram . . . . . . . . . . 239 15-3 serial peripheral interface block diagram . . . . . . . . . . . . . . . 251 15-4 spi clock format 0 (cpha = 0) . . . . . . . . . . . . . . . . . . . . . . . 252 15-5 spi clock format 1 (cpha = 1) . . . . . . . . . . . . . . . . . . . . . . . 253 15-6 normal mode and bidirectional mode. . . . . . . . . . . . . . . . . . . 254 16-1 mi bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 16-2 biphase coding and error detection . . . . . . . . . . . . . . . . . . . . 266 16-3 mi bus block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 16-4 a typical mi bus interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 17-1 the can system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 17-2 user model for message buffer organization. . . . . . . . . . . . . 282 17-3 32-bit maskable identifier acceptance filters . . . . . . . . . . . . . 286 17-4 16-bit maskable acceptance filters . . . . . . . . . . . . . . . . . . . . 286 17-5 8-bit maskable acceptance filters . . . . . . . . . . . . . . . . . . . . . 287 17-6 sleep request / acknowledge cycle . . . . . . . . . . . . . . . . . . 293 17-7 clocking scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 17-8 segments within the bit time . . . . . . . . . . . . . . . . . . . . . . . . . 297 17-9 mscan12 memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . .298 17-10 message buffer organization . . . . . . . . . . . . . . . . . . . . . . . . .299 17-11 receive/transmit message buffer extended identifier. . . . . . 300 17-12 standard identifier mapping . . . . . . . . . . . . . . . . . . . . . . . . . .301 18-1 analog-to-digital converter block diagram . . . . . . . . . . . . . . 324 19-1 bdm host to target serial bit timing. . . . . . . . . . . . . . . . . . . 341 19-2 bdm target to host serial bit timing (logic 1) . . . . . . . . . . . 341 19-3 bdm target to host serial bit timing (logic 0) . . . . . . . . . . . 342 20-1 v fp conditioning circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . .373 20-2 v fp operating range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 20-3 timer inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 20-4 por and external reset timing diagram . . . . . . . . . . . . . . . 376 20-5 stop recovery timing diagram . . . . . . . . . . . . . . . . . . . . . .377 20-6 wait recovery timing diagram . . . . . . . . . . . . . . . . . . . . . . 378 20-7 interrupt timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
list of figures 68hc(9)12d60 ? rev 3.0 advance information motorola list of figures 21 20-8 port read timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 20-9 port write timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 20-10 multiplexed expansion bus timing diagram . . . . . . . . . . . . . 382 20-11 spi timing diagram (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . 384 20-12 spi timing diagram (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . 385
list of figures advance information 68hc(9)12d60 ? rev 3.0 22 list of figures motorola
68hc(9)12d60 ? rev 3.0 advance information motorola general description 23 advance information ? 68hc(9)12d60 section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.4 ordering information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.5 68hc(9)12d60 block diagrams . . . . . . . . . . . . . . . . . . . . . . . . 29 1.2 introduction the 68hc(9)12d60 microcontroller unit (mcu) is a 16-bit device available in two package options, 80-pin qfp and 112-pin tqfp. on- chip peripherals include a 16-bit central processing unit (cpu12), 60k bytes of flash eeprom (68hc912d60) or rom (68hc12d60), 2k bytes of ram, 1k bytes of eeprom, two asynchronous serial communication interfaces (sci), a serial peripheral interface (spi), an enhanced capture timer (ect), two (one on 80qfp) 8-channel,10-bit analog-to-digital converters (atd), a four-channel pulse-width modulator (pwm), and a can 2.0 a, b software compatible module (mscan12). system resource mapping, clock generation, interrupt control and bus interfacing are managed by the lite integration module (lim). the 68hc(9)12d60 has full 16-bit data paths throughout, however, the external bus can operate in an 8-bit narrow mode so single 8-bit wide memory can be interfaced for lower cost systems. the inclusion of a pll circuit allows power consumption and performance to be adjusted to suit operational requirements. in addition to the i/o ports available in each module, 16 (2 on 80qfp) i/o port pins are available with key-wake-up capability from stop or wait mode.
general description advance information 68hc(9)12d60 ? rev 3.0 24 general description motorola 1.3 features  16-bit cpu12 ? upward compatible with m68hc11 instruction set ? interrupt stacking and programmer ? s model identical to m68hc11 ? 20-bit alu ? instruction queue ? enhanced indexed addressing  multiplexed bus ? single chip or expanded ? 16 address/16 data wide or 16 address/8 data narrow mode  two 8-bit ports with key wake-up interrupt (2 pins only are available on 80qfp) and one i 2 c start bit detector (112tqfp only)  memory ? 60k byte flash eeprom, made of a 28k module and a 32k module with 8k bytes protected boot section in each module (68hc912d60) ? 60k byte rom (68hc12d60) ? 1k byte eeprom ? 2k byte ram  analog-to-digital converters ? 2 x 8-channels, 10-bit resolution in 112tqfp ? 1 x 8-channels, 8-bit resolution in 80qfp  1m bit per second, can 2.0 a, b software compatible module ? two receive and three transmit buffers ? flexible identifier filter programmable as 2 x 32 bit, 4 x 16 bit or 8x8bit ? four separate interrupt channels for rx, tx, error and wake-up
general description features 68hc(9)12d60 ? rev 3.0 advance information motorola general description 25 ? low-pass filter wake-up function ? in 80qfp, only txcan and rxcan pins are available ? loop-back for self test operation ? programmable link to a timer input capture channel, for time- stamping and network synchronization.  enhanced capture timer (ect) ? 16-bit main counter with 7-bit prescaler ? 8 programmable input capture or output compare channels; 4 of the 8 input captures with buffer ? input capture filters and buffers, three successive captures on four channels, or two captures on four channels with a capture/compare selectable on the remaining four ? four 8-bit or two 16-bit pulse accumulators ? 16-bit modulus down-counter with 4-bit prescaler ? four user-selectable delay counters for signal filtering  4 pwm channels with programmable period and duty cycle ? 8-bit 4-channel or 16-bit 2-channel ? separate control for each pulse width and duty cycle ? center- or left-aligned outputs ? programmable clock select logic with a wide range of frequencies  serial interfaces ? two asynchronous serial communications interfaces (sci) ? mi-bus implemented on final devices ? synchronous serial peripheral interface (spi)  lim (light integration module) ? wcr (windowed cop watchdog, real time interrupt, clock monitor) ? roc (reset and clocks)
general description advance information 68hc(9)12d60 ? rev 3.0 26 general description motorola ? mebi (multiplexed external bus interface) ? mbi (internal bus interface and map) ? int (interrupt control)  clock generation ? phase-locked loop clock frequency multiplier ? limp home mode in absence of external clock ? slow mode divider ? low power 0.5 to 16 mhz crystal oscillator reference clock  112-pin tqfp package or 80-pin qfp package ? up to 68 general-purpose i/o lines, plus up to 18 input-only lines in 112tqfp or up to 48 general-purpose i/o lines, plus up to 10 input-only lines in 80qfp  8mhz operation at 5v  development support ? single-wire background debug ? mode (bdm) ? on-chip hardware breakpoints
general description ordering information 68hc(9)12d60 ? rev 3.0 advance information motorola general description 27 1.4 ordering information * important: m temperature operation is available only for single chip modes table 1-1. device ordering information package temperature voltage frequency order number range designator 112-pin tqfp single tray 60 pcs 0 to +70 c 4.5v ? 5.5v 8 mhz xc68hc912d60pv8 ? 40 to +85 c c xc68hc912d60cpv8 ? 40 to +105 c v xc68hc912d60vpv8 ? 40 to +125 c m* xc68hc912d60mpv8 80-pin qfp single tray 84 pcs 0 to +70 c 4.5v ? 5.5v 8 mhz xc68hc912d60fu8 ? 40 to +85 c c xc68hc912d60cfu8 ? 40 to +105 c v xc68hc912d60vfu8 ? 40 to +125 c m* xc68hc912d60mfu8 112-pin tqfp single tray 60 pcs 0 to +70 c 4.5v ? 5.5v 8 mhz xc68hc12d60pv8 ? 40 to +85 c c xc68hc12d60cpv8 ? 40 to +105 c v xc68hc12d60vpv8 ? 40 to +125 c m* xc68hc12d60mpv8 80-pin qfp single tray 84 pcs 0 to +70 c 4.5v ? 5.5v 8 mhz xc68hc12d60fu8 ? 40 to +85 c c xc68hc12d60cfu8 ? 40 to +105 c v xc68hc12d60vfu8 ? 40 to +125 c m* xc68hc12d60mfu8
general description advance information 68hc(9)12d60 ? rev 3.0 28 general description motorola note: sdbug12 is a p & e micro product. it can be obtained from p & e from their web site (http://www.pemicro.com) for approximately $100. third party tools: http://www.mcu.motsps.com/dev_tools/3rd/index.html table 1-2. 68hc(9)12d60 development tools ordering information description name order number mcuez free from world wide web serial debug interface sdi m68sdil (3 ? 5v), m68dil12 (sdil + mcuez + sdbug12) evaluation board evb m68evb912d60 (evb only) m68kit912d60 (evb + sdil12)
general description 68hc(9)12d60 block diagrams 68hc(9)12d60 ? rev 3.0 advance information motorola general description 29 1.5 68hc(9)12d60 block diagrams figure 1-1. 68hc(9)12d60 112-pin qfp block diagram txcan ddrg portg kwg4 kwg3 kwg2 kwg1 kwg0 pg7 kwg6 kwg5 pg4 pg3 pg2 pg1 pg0 pg7 pg6 pg5 ddrh porth ph4 ph3 ph2 ph1 ph0 ph7 ph6 ph5 kwh4 kwh3 kwh2 kwh1 kwh0 kwh7 kwh6 kwh5 pgpud phpud pgpud phpud ioc0 ioc1 ioc2 ioc3 ioc4 ioc5 ioc6 ioc7 ddrt port t 60k byte flash eeprom * 2k byte ram port e enhanced pt0 pt1 pt2 pt3 pt4 pt5 pt6 pt7 spi ddrs port s port ad1 pe1 pe2 pe4 pe5 pe6 pe3 pad13 pad14 pad15 pad16 pad17 vddad vssad vrh1 vrl1 pad10 pad11 pad12 reset extal xtal pw0 pw1 pw2 pw3 pwm ddrp port p pp0 pp1 pp2 pp3 vdd 2 vss 2 sci0 (mi bus) rxd0 txd0 rxd1 txd1 siso/miso momi/mosi sck ss ps0 ps1 ps2 ps3 ps4 ps5 ps6 ps7 1k byte eeprom pe0 pe7 an13 an14 an15 an16 an17 vddad vssad vrh1 vrl1 an10 an11 an12 bkgd eclk r/w lstrb /taglo moda/ipipe0 modb/ipipe1/cgmtst xirq dbe/ cal/eclk capture timer lite irq pcan7 pcan6 pcan5 pcan4 sci1 integration module (lim) vfp * cpu12 periodic interrupt cop watchdog clock monitor single-wire background debug module breakpoints pll vsspll xfc vddpll can rxcan ddra port a ddrb port b pa4 pa3 pa2 pa1 pa0 pa7 pa6 pa5 pb4 pb3 pb2 pb1 pb0 pb7 pb6 pb5 data15 multiplexed address/data bus a d d r 1 5 a d d r 1 4 a d d r 1 3 a d d r 1 2 a d d r 1 1 a d d r 1 0 a d d r 9 a d d r 8 data14 data13 data12 data11 data10 data9 data8 a d d r 7 a d d r 6 a d d r 5 a d d r 4 a d d r 3 a d d r 2 a d d r 1 a d d r 0 data7 data6 data5 data4 data3 data2 data1 data0 atd1 port ad0 pad03 pad04 pad05 pad06 pad07 vrh0 vrl0 pad00 pad01 pad02 an03 an04 an05 an06 an07 vddad vssad vrh0 vrl0 an00 an01 an02 atd0 i/o data7 data6 data5 data4 data3 data2 data1 data0 wide bus narrow bus pcan1 pcan0 vddx 2 vssx 2 power for internal circuitry power for i/o drivers i/o pp4 pp5 pp6 pp7 pcan3 pcan2 * 68hc912d60 only $ 68hc12d60 only on the 68hc12d60 this pin is not connected and can be tied to 5v or 12v without effect. 60k byte rom $ notes:
general description advance information 68hc(9)12d60 ? rev 3.0 30 general description motorola figure 1-2. 68hc(9)12d60 80-pin qfp block diagram pt0 pt1 pt2 pt3 pt4 pt5 pt6 pt7 txcan ddrg portg kwg4 kwg3 kwg2 kwg1 kwg0 pg7 kwg6 kwg5 pg4 ddrh porth ph4 kwh4 kwh3 kwh2 kwh1 kwh0 kwh7 kwh6 kwh5 pgpud(vdd) phpud(vss) ioc0 ioc1 ioc2 ioc3 ioc4 ioc5 ioc6 ioc7 ddrt port t 60k byte flash eeprom * 2k byte ram port e enhanced spi ddrs port s pe1 pe2 pe4 pe5 pe6 pe3 vddad vssad reset extal xtal pw0 pw1 pw2 pw3 pwm ddrp port p pp0 pp1 pp2 pp3 vdd 2 vss 2 sci0 (mi bus) rxd0 txd0 rxd1 txd1 siso/miso momi/mosi sck ss ps0 ps1 ps2 ps3 ps4 ps5 ps6 ps7 1k byte eeprom pe0 pe7 bkgd capture timer sci1 vfp * cpu12 periodic interrupt cop watchdog clock monitor single-wire background debug module breakpoints pll vsspll xfc vddpll can rxcan ddra port a ddrb port b pa4 pa3 pa2 pa1 pa0 pa7 pa6 pa5 pb4 pb3 pb2 pb1 pb0 pb7 pb6 pb5 data15 multiplexed address/data bus a d d r 1 5 a d d r 1 4 a d d r 1 3 a d d r 1 2 a d d r 1 1 a d d r 1 0 a d d r 9 a d d r 8 data14 data13 data12 data11 data10 data9 data8 a d d r 7 a d d r 6 a d d r 5 a d d r 4 a d d r 3 a d d r 2 a d d r 1 a d d r 0 data7 data6 data5 data4 data3 data2 data1 data0 port ad0 pad03 pad04 pad05 pad06 pad07 vrh0 vrl0 pad00 pad01 pad02 an03 an04 an05 an06 an07 vddad vssad vrh0 vrl0 an00 an01 an02 atd0 i/o data7 data6 data5 data4 data3 data2 data1 data0 wide bus narrow bus pcan1 pcan0 vddx 2 vssx 2 power for internal circuitry power for i/o drivers pp4 pp5 pp6 pp7 ddrcan port can pcan7 pcan6 pcan5 pcan4 pcan3 pcan2 eclk r/w lstrb /taglo moda/ipipe0 modb/ipipe1/cgmtst xirq dbe/ cal/eclk lite irq integration module (lim) port ad1 an13 an14 an15 an16 an17 vddad vssad vrh1 vrl1 an10 an11 an12 atd1 * 68hc912d60 only $ 68hc12d60 only on the 68hc12d60 this pin is not connected and can be tied to 5v or 12v without effect. several i/o on ports g, h and can are unavailable externally on the 80-pin qfp package. these in- ternal pins should either be defined as outputs or have their pull-ups/downs enabled. 60k byte rom $ notes:
68hc(9)12d60 ? rev 3.0 advance information motorola central processing unit 31 advance information ? 68hc(9)12d60 section 2. central processing unit 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.3 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.4 data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.5 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 2.6 indexed addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . .35 2.7 opcodes and operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 2.2 introduction the cpu12 is a high-speed, 16-bit processing unit. it has full 16-bit data paths and wider internal registers (up to 20 bits) for high-speed extended math instructions. the instruction set is a proper superset of the m68hc11instruction set. the cpu12 allows instructions with odd byte counts, including many single-byte instructions. this provides efficient use of rom space. an instruction queue buffers program information so the cpu always has immediate access to at least three bytes of machine code at the start of every instruction. the cpu12 also offers an extensive set of indexed addressing capabilities. 2.3 programming model cpu12 registers are an integral part of the cpu and are not addressed as if they were memory locations.
central processing unit advance information 68hc(9)12d60 ? rev 3.0 32 central processing unit motorola figure 2-1. programming model accumulators a and b are general-purpose 8-bit accumulators used to hold operands and results of arithmetic calculations or data manipulations. some instructions treat the combination of these two 8- bit accumulators as a 16-bit double accumulator (accumulator d). index registers x and y are used for indexed addressing mode. in the indexed addressing mode, the contents of a 16-bit index register are added to 5-bit, 9-bit, or 16-bit constants or the content of an accumulator to form the effective address of the operand to be used in the instruction. stack pointer (sp) points to the last stack location used. the cpu12 supports an automatic program stack that is used to save system context during subroutine calls and interrupts, and can also be used for temporary storage of data. the stack pointer can also be used in all indexed addressing modes. program counter is a 16-bit register that holds the address of the next instruction to be executed. the program counter can be used in all indexed addressing modes except autoincrement/decrement. 7 15 15 15 15 15 d ix iy sp pc ab n sxh i zvc 0 0 0 0 0 0 7 0 condition code register 8-bit accumulators a & b 16-bit double accumulator d index register x index register y stack pointer program counter or
central processing unit data types 68hc(9)12d60 ? rev 3.0 advance information motorola central processing unit 33 condition code register (ccr) contains five status indicators, two interrupt masking bits, and a stop disable bit. the five flags are half carry (h), negative (n), zero (z), overflow (v), and carry/borrow (c). the half-carry flag is used only for bcd arithmetic operations. the n, z, v, and c status bits allow for branching based on the results of a previous operation. after a reset, the cpu fetches a vector from the appropriate address and begins executing instructions. the x and i interrupt mask bits are set to mask any interrupt requests. the s bit is also set to inhibit the stop instruction. 2.4 data types the cpu12 supports the following data types:  bit data  8-bit and 16-bit signed and unsigned integers  16-bit unsigned fractions  16-bit addresses a byte is eight bits wide and can be accessed at any byte location. a word is composed of two consecutive bytes with the most significant byte at the lower value address. there are no special requirements for alignment of instructions or operands. 2.5 addressing modes addressing modes determine how the cpu accesses memory locations to be operated upon. the cpu12 includes all of the addressing modes of the m68hc11 cpu as well as several new forms of indexed addressing. table 2-1 is a summary of the available addressing modes.
central processing unit advance information 68hc(9)12d60 ? rev 3.0 34 central processing unit motorola table 2-1. m68hc12 addressing mode summary addressing mode source format abbreviation description inherent inst (no externally supplied operands) inh operands (if any) are in cpu registers immediate inst # opr8i or inst # opr16i imm operand is included in instruction stream 8- or 16-bit size implied by context direct inst opr8a dir operand is the lower 8-bits of an address in the range $0000 ? $00ff extended inst opr16a ext operand is a 16-bit address relative inst rel8 or inst rel16 rel an 8-bit or 16-bit relative offset from the current pc is supplied in the instruction indexed (5-bit offset) inst oprx5 , xysp idx 5-bit signed constant offset from x, y, sp, or pc indexed (auto pre-decrement) inst oprx3 , ? xys idx auto pre-decrement x, y, or sp by 1 ~ 8 indexed (auto pre-increment) inst oprx3 ,+ xys idx auto pre-increment x, y, or sp by 1 ~ 8 indexed (auto post-decrement) inst oprx3 , xys ? idx auto post-decrement x, y, or sp by 1 ~ 8 indexed (auto post-increment) inst oprx3 , xys + idx auto post-increment x, y, or sp by 1 ~ 8 indexed (accumulator offset) inst abd , xysp idx indexed with 8-bit (a or b) or 16-bit (d) accumulator offset from x, y, sp, or pc indexed (9-bit offset) inst oprx9 , xysp idx1 9-bit signed constant offset from x, y, sp, or pc (lower 8-bits of offset in one extension byte) indexed (16-bit offset) inst oprx16 , xysp idx2 16-bit constant offset from x, y, sp, or pc (16-bit offset in two extension bytes) indexed-indirect (16-bit offset) inst [ oprx16 , xysp ] [idx2] pointer to operand is found at... 16-bit constant offset from x, y, sp, or pc (16-bit offset in two extension bytes) indexed-indirect (d accumulator offset) inst [d, xysp ] [d,idx] pointer to operand is found at... x, y, sp, or pc plus the value in d
central processing unit indexed addressing modes 68hc(9)12d60 ? rev 3.0 advance information motorola central processing unit 35 2.6 indexed addressing modes the cpu12 indexed modes reduce execution time and eliminate code size penalties for using the y index register. cpu12 indexed addressing uses a postbyte plus zero, one, or two extension bytes after the instruction opcode. the postbyte and extensions do the following tasks:  specify which index register is used.  determine whether a value in an accumulator is used as an offset.  enable automatic pre- or post-increment or decrement  specify use of 5-bit, 9-bit, or 16-bit signed offsets. table 2-2. summary of indexed operations postbyte code (xb) source code syntax comments rr0nnnnn ,r n,r ? n,r 5-bit constant offset n = ? 16 to +15 rr can specify x, y, sp, or pc 111rr0zs n,r ? n,r constant offset (9- or 16-bit signed) z-0 = 9-bit with sign in lsb of postbyte(s) 1 = 16-bit if z = s = 1, 16-bit offset indexed-indirect (see below) rr can specify x, y, sp, or pc 111rr011 [n,r] 16-bit offset indexed-indirect rr can specify x, y, sp, or pc rr1pnnnn n, ? r n,+r n,r ? n,r+ auto pre-decrement/increment or auto post- decrement/increment ; p = pre-(0) or post-(1), n = ? 8 to ? 1, +1 to +8 rr can specify x, y, or sp (pc not a valid choice) 111rr1aa a,r b,r d,r accumulator offset (unsigned 8-bit or 16-bit) aa-00 = a 01 = b 10 = d (16-bit) 11 = see accumulator d offset indexed-indirect rr can specify x, y, sp, or pc 111rr111 [d,r] accumulator d offset indexed-indirect rr can specify x, y, sp, or pc
central processing unit advance information 68hc(9)12d60 ? rev 3.0 36 central processing unit motorola 2.7 opcodes and operands the cpu12 uses 8-bit opcodes. each opcode identifies a particular instruction and associated addressing mode to the cpu. several opcodes are required to provide each instruction with a range of addressing capabilities. only 256 opcodes would be available if the range of values were restricted to the number that can be represented by 8-bit binary numbers. to expand the number of opcodes, a second page is added to the opcode map. opcodes on the second page are preceded by an additional byte with the value $18. to provide additional addressing flexibility, opcodes can also be followed by a postbyte or extension bytes. postbytes implement certain forms of indexed addressing, transfers, exchanges, and loop primitives. extension bytes contain additional program information such as addresses, offsets, and immediate data.
68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 37 advance information ? 68hc(9)12d60 section 3. pinout and signal descriptions 3.1 contents 3.2 68hc(9)12d60 pin assignments in 112-pin qfp. . . . . . . . . . . 38 3.3 68hc(9)12d60 pin assignments in 80-pin qfp. . . . . . . . . . . . 40 3.4 power supply pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 3.5 signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.6 port signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 38 pinout and signal descriptions motorola 3.2 68hc(9)12d60 pin assignments in 112-pin qfp figure 3-1. pin assignments in 112-pin tqfp for 68hc(9)12d60 * available on 68hc912d60 only. on the 68hc12d60 this pin is not connected and can be tied to 5v or 12v without effect. pp3/pw3 pp4 pp5 pp6 pp7 v ddx v ssx pcan0/rxcan pcan1/txcan pcan2 pcan3 pcan4 pcan5 pcan6 pcan7 v fp * ps7/ss ps6/sck ps5/sdo/mosi ps4/sdi/miso ps3/txd1 ps2/rxd1 ps1/txd0 ps0/rxd0 v ssa v rl1 v rh1 v dda 68hc(9)12d60 112tqfp pad17/an17 pad07/an07 pad16/an16 pad06/an06 pad15/an15 pad05/an05 pad14/an14 pad04/an04 pad13/an13 pad03/an03 pad12/an12 pad02/an02 pad11/an11 pad01/an01 pad10/an10 pad00/an00 v rl0 v rh0 v ss v dd pa7/addr15/data15/data7 pa6/addr14/data14/data6 pa5/addr13/data13/data5 pa4/addr12/data12/data4 pa3/addr11/data11/data3 pa2/addr10/data10/data2 pa1/addr9/data9/data1 pa0/addr8/data8/data0 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 addr6/data6/pb6 addr7/data7/pb7 kwh7/ph7 kwh6/ph6 kwh5/ph5 kwh4/ph4 eclk /dbe /cal/pe7 cgmtst/modb/ipipe1/pe6 moda/ipipe0/pe5 eclk/pe4 v ssx phupd v ddx v ddpll xfc v sspll reset extal xtal kwh3/ph3 kwh2/ph2 kwh1/ph1 kwh0/ph0 lstrb /taglo /pe3 r/w /pe2 irq /pe1 xirq /pe0 pw2/pp2 pw1/pp1 pw0/pp0 ioc0/pt0 ioc1/pt1 ioc2/pt2 ioc3/pt3 pg7 kwg6/pg6 kwg5/pg5 kwg4/pg4 v dd pgupd v ss ioc4/pt4 ioc5/pt5 ioc6/pt6 ioc7/pt7 kwg3/pg3 kwg2/pg2 kwg1/pg1 kwg0/pg0 smodn/taghi /bkgd addr0/data0/pb0 addr1/data1/pb1 addr2/data2/pb2 addr3/data3/pb3 addr4/data4/pb4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 addr5/data5/pb5
pinout and signal descriptions 68hc(9)12d60 pin assignments in 112-pin qfp 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 39 figure 3-2. 112-pin tqfp mechanical dimensions (case no. 987) dim a min max 20.000 bsc millimeters a1 10.000 bsc b 20.000 bsc b1 10.000 bsc c --- 1.600 c1 0.050 0.150 c2 1.350 1.450 d 0.270 0.370 e 0.450 0.750 f 0.270 0.330 g 0.650 bsc j 0.090 0.170 k 0.500 ref p 0.325 bsc r1 0.100 0.200 r2 0.100 0.200 s 22.000 bsc s1 11.000 bsc v 22.000 bsc v1 11.000 bsc y 0.250 ref z 1.000 ref aa 0.090 0.160 11 11 13 7 13 view y l-m 0.20 n t 4x 4x 28 tips pin 1 ident 1 112 85 84 28 57 29 56 b v v1 b1 a1 s1 a s view ab 0.10 3 c c2 2 0.050 seating plane gage plane 1 view ab c1 (z) (y) e (k) r2 r1 0.25 j1 view y j1 p g 108x 4x section j1-j1 base rotated 90 counterclockwise metal j aa f d l-m m 0.13 n t 1 2 3 c l l-m 0.20 n t l n m t t 112x x x=l, m or n r r 8 3 0 notes: 1. dimensioning and tolerancing per asme y14.5m, 1994. 2. dimensions in millimeters. 3. datums l, m and n to be determined at seating plane, datum t. 4. dimensions s and v to be determined at seating plane, datum t. 5. dimensions a and b do not include mold protrusion. allowable protrusion is 0.25 per side. dimensions a and b include mold mismatch. 6. dimension d does not include dambar protrusion. allowable dambar protrusion shall not cause the d dimension to exceed 0.46.
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 40 pinout and signal descriptions motorola 3.3 68hc(9)12d60 pin assignments in 80-pin qfp figure 3-3. pin assignments in 80-pin qfp for 68hc(9)12d60 * available on 68hc912d60 only. on the 68hc12d60 this pin is not connected and can be tied to 5v or 12v without effect. 60 59 57 56 55 54 53 52 51 50 49 48 47 46 45 58 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 3 44 43 42 41 18 20 19 17 80 79 77 76 75 74 73 72 71 70 69 68 67 66 65 78 64 63 62 61 21 22 24 25 26 27 28 29 30 31 32 33 34 35 36 23 38 40 39 37 68hc(9)12d60 80 qfp pp3/pw3 pp4 pp5 pp6 pp7 v ddx v ssx pcan0/rxcan pcan1/txcan v fp * ps7/ss ps6/sck ps5/sdo/mosi ps4/sdi/miso ps3/txd1 ps2/rxd1 ps1/txd0 ps0/rxd0 v ssad v ddad pad07/an07 pad06/an06 pad05/an05 pad04/an04 pad03/an03 pad02/an02 pad01/an01 pad00/an00 v rl0 v rh0 v ss v dd pa7/addr15/data15/data7 pa6/addr14/data14/data6 pa5/addr13/data13/data5 pa4/addr12/data12/data4 pa3/addr11/data11/data3 pa2/addr10/data10/data2 pa1/addr9/data9/data1 pa0/addr8/data8/data0 addr5/data5/pb5 addr6/data6/pb6 addr7/data7/pb7 kwh4/ph4 eclk /dbe /cal/pe7 cgmtst/modb/ipipe1/pe6 moda/ipipe0/pe5 eclk/pe4 v ssx v ddx v ddpll xfc v sspll reset extal xtal lstrb /taglo /pe3 r/w /pe2 irq /pe1 xirq /pe0 pw2/pp2 pw1/pp1 pw0/pp0 ioc0/pt0 ioc1/pt1 ioc2/pt2 ioc3/pt3 kwg4/pg4 v dd v ss ioc4/pt4 ioc5/pt5 ioc6/pt6 ioc7/pt7 smodn/taghi/ bkgd addr0/data0/pb0 addr1/data1/pb1 addr2/data2/pb2 addr3/data3/pb3 addr4/data4/pb4
pinout and signal descriptions 68hc(9)12d60 pin assignments in 80-pin qfp 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 41 figure 3-4. 80-pin qfp mechanical dimensions (case no. 841b) notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. datum plane -h- is located at bottom of lead and is coincident with the lead where the lead exits the plastic body at the bottom of the parting line. 4. datums -a-, -b- and -d- to be determined at datum plane -h-. 5. dimensions s and v to be determined at seating plane -c-. 6. dimensions a and b do not include mold protrusion. allowable protrusion is 0.25 per side. dimensions a and b do include mold mismatch and are determined at datum plane -h-. 7. dimension d does not include dambar protrusion. allowable dambar protrusion shall be 0.08 total in excess of the d dimension at maximum material condition. dambar cannot be located on the lower radius or the foot. section b-b 61 60 detail a l 41 40 80 -a- l -d- a s a-b m 0.20 d s h 0.05 a-b s 120 21 -b- b v j f n d view rotated 90 detail a b b p -a-,-b-,-d- e h g m m detail c seating plane -c- c datum plane 0.10 -h- datum plane -h- u t r q k w x detail c dim min max millimeters a 13.90 14.10 b 13.90 14.10 c 2.15 2.45 d 0.22 0.38 e 2.00 2.40 f 0.22 0.33 g 0.65 bsc h --- 0.25 j 0.13 0.23 k 0.65 0.95 l 12.35 ref m 5 10 n 0.13 0.17 p 0.325 bsc q 0 7 r 0.13 0.30 s 16.95 17.45 t 0.13 --- u 0 --- v 16.95 17.45 w 0.35 0.45 x 1.6 ref s a-b m 0.20 d s c s a-b m 0.20 d s h 0.05 d s a-b m 0.20 d s c s a-b m 0.20 d s c
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 42 pinout and signal descriptions motorola 3.4 power supply pins 68hc(9)12d60 power and ground pins are described below and summarized in table 3-1 . 3.4.1 internal power (v dd ) and ground (v ss ) power is supplied to the mcu through v dd and v ss . because fast signal transitions place high, short-duration current demands on the power supply, use bypass capacitors with high-frequency characteristics and place them as close to the mcu as possible. bypass requirements depend on how heavily the mcu pins are loaded. 3.4.2 external power (v ddx ) and ground (v ssx ) external power and ground for i/o drivers. because fast signal transitions place high, short-duration current demands on the power supply, use bypass capacitors with high-frequency characteristics and place them as close to the mcu as possible. bypass requirements depend on how heavily the mcu pins are loaded. 3.4.3 v dda , v ssa provides operating voltage and ground for the analog-to-digital converter. this allows the supply voltage to the atd to be bypassed independently. connecting v dda to v dd if the atd modules are not used will not result in an increase of power consumption. 3.4.4 analog to digital reference voltages (v rh , v rl ) v rh0 , v rl0 : reference voltage high and low for atd converter 0. v rh1 , v rl1 : reference voltage high and low for atd converter 1. if the atd modules are not used, leaving v rh connected to v dd will not result in an increase of power consumption.
pinout and signal descriptions power supply pins 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 43 3.4.5 v ddpll , v sspll provides operating voltage and ground for the phased-locked loop. this allows the supply voltage to the pll to be bypassed independently. note: the vsspll pin should always be grounded even if the pll is not used. the vddpll pin should not be left floating. it is recommended to connect the vddpll pin to ground if the pll is not used. 3.4.6 xfc pll loop filter. please see appendix: cgm practical aspects for information on how to calculate pll loop filter elements. any current leakage on this pin must be avoided. figure 3-5. pll loop filter connections if vddpll is connected to vss (this is normal case), then the xfc pin should either be left floating or connected to vss ( never to vdd). if vddpll is tied to vdd but the pll is switched off (pllon bit cleared), then the xfc pin should be connected preferably to vddpll (i.e. ready for vco minimum frequency). 3.4.7 v fp flash eeprom programming voltage and supply voltage during normal operation (68hc912d60 only ? on the 68hc12d60 this pin is not connected and can be tied to 5v or 12v without effect). mcu xfc r 0 c 0 c p vddpll
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 44 pinout and signal descriptions motorola 3.5 signal descriptions 3.5.1 crystal driver and external clock input (xtal, extal) these pins provide the interface for either a crystal or a cmos compatible clock to control the internal clock generator circuitry. out of reset the frequency applied to extal is twice the desired e ? clock rate. all the device clocks are derived from the extal input frequency. note: crystal circuit is changed from standard. table 3-1. 68hc(9)12d60 power and ground connection summary mnemonic pin number description 80-pin qfp 112-pin qfp v dd 9, 49 12, 65 internal power and ground. v ss 10, 50 14, 66 v ddx 30, 75 42, 107 external power and ground, supply to pin drivers. v ssx 29, 74 40, 106 v dda 61 85 operating voltage and ground for the analog-to-digital converter, allows the supply voltage to the a/d to be bypassed independently. v ssa 62 88 v rh1 ? 86 reference voltages for the analog-to-digital converter 1 v rl1 ? 87 v rh0 51 67 reference voltages for the analog-to-digital converter 0. v rl0 52 68 v ddpll 31 43 provides operating voltage and ground for the phased-locked loop. this allows the supply voltage to the pll to be bypassed independently. v sspll 33 45 v fp 71 97 programming voltage for the flash eeprom and required supply for normal operation. (68hc912d60 only ? on the 68hc12d60 this pin is not connected and can be tied to 5v or 12v without effect)
pinout and signal descriptions signal descriptions 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 45 note: the internal return path for the oscillator is the vsspll pin. therefore it is recommended to connect the common node of the resonator and the capacitor directly to the vsspll pin. figure 3-6. common crystal connections note: when selecting a crystal, it is recommended to use one with the lowest possible frequency in order to minimise emc emissions. figure 3-7. external oscillator connections xtal is the crystal output.the xtal pin must be left unterminated when an external cmos compatible clock input is connected to the extal pin. the xtal output is normally intended to drive only a crystal. the xtal output can be buffered with a high-impedance buffer to drive the extal input of another device. in all cases take extra care in the circuit board layout around the oscillator pins. load capacitances in the oscillator circuits include all stray layout capacitances. refer to figure 3-6 and figure 3-7 for diagrams of oscillator circuits. c mcu c extal xtal 2 x e crystal or ceramic resonator nc mcu extal xtal 2 x e cmos-compatible external oscillator
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 46 pinout and signal descriptions motorola 3.5.2 e-clock output (eclk) eclk is the output connection for the internal bus clock and is used to demultiplex the address and data and is used as a timing reference. eclk frequency is equal to 1/2 the crystal frequency out of reset. the e- clock output is turned off in single chip user mode to reduce the effects of rfi. it can be turned on if necessary. in single-chip special mode, the e-clock is turned on at reset and can be turned off. in special peripheral mode the e-clock is an input to the mcu. all clocks, including the e clock, are halted when the mcu is in stop mode. it is possible to configure the mcu to interface to slow external memory. eclk can be stretched for such accesses. 3.5.3 reset (reset ) an active low bidirectional control signal, reset , acts as an input to initialize the mcu to a known start-up state. it also acts as an open-drain output to indicate that an internal failure has been detected in either the clock monitor or cop watchdog circuit. the mcu goes into reset asynchronously and comes out of reset synchronously. this allows the part to reach a proper reset state even if the clocks have failed, while allowing synchronized operation when starting out of reset. it is important to use an external low-voltage reset circuit (such as mc34064 or mc34164) to prevent corruption of ram or eeprom due to power transitions. the reset sequence is initiated by any of the following events:  power-on-reset (por)  cop watchdog enabled and watchdog timer times out  clock monitor enabled and clock monitor detects slow or stopped clock  user applies a low level to the reset pin external circuitry connected to the reset pin should not include a large capacitance that would interfere with the ability of this signal to rise to a valid logic one within nine bus cycles after the low drive is released.
pinout and signal descriptions signal descriptions 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 47 upon detection of any reset, an internal circuit drives the reset pin low and a clocked reset sequence controls when the mcu can begin normal processing. in the case of por or a clock monitor error, a 4096 cycle oscillator startup delay is imposed before the reset recovery sequence starts (reset is driven low throughout this 4096 cycle delay). the internal reset recovery sequence then drives reset low for 16 to 17 cycles and releases the drive to allow reset to rise. nine cycles later this circuit samples the reset pin to see if it has risen to a logic one level. if reset is low at this point, the reset is assumed to be coming from an external request and the internally latched states of the cop timeout and clock monitor failure are cleared so the normal reset vector ($fffe:ffff) is taken when reset is finally released. if reset is high after this nine cycle delay, the reset source is tentatively assumed to be either a cop failure or a clock monitor fail. if the internally latched state of the clock monitor fail circuit is true, processing begins by fetching the clock monitor vector ($fffc:fffd). if no clock monitor failure is indicated, and the latched state of the cop timeout is true, processing begins by fetching the cop vector ($fffa:fffb). if neither clock monitor fail nor cop timeout are pending, processing begins by fetching the normal reset vector ($fffe:ffff). 3.5.4 maskable interrupt request (irq ) the irq input provides a means of applying asynchronous interrupt requests to the mcu. either falling edge-sensitive triggering or level- sensitive triggering is program selectable (intcr register). irq is always enabled and configured to level-sensitive triggering at reset. it can be disabled by clearing the irqen bit (intcr register). when the mcu is reset the irq function is masked in the condition code register. this pin is always an input and can always be read. there is an active pull-up on this pin while in reset and immediately out of reset. the pull- up can be turned off by clearing pupe in the pucr register.
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 48 pinout and signal descriptions motorola 3.5.5 nonmaskable interrupt (xirq ) the xirq input provides a means of requesting a nonmaskable interrupt after reset initialization. during reset, the x bit in the condition code register (ccr) is set and any interrupt is masked until mcu software enables it. because the xirq input is level sensitive, it can be connected to a multiple-source wired-or network. this pin is always an input and can always be read. there is an active pull-up on this pin while in reset and immediately out of reset. the pull-up can be turned off by clearing pupe in the pucr register. xirq is often used as a power loss detect interrupt. whenever xirq or irq are used with multiple interrupt sources (irq must be configured for level-sensitive operation if there is more than one source of irq interrupt), each source must drive the interrupt input with an open-drain type of driver to avoid contention between outputs. there must also be an interlock mechanism at each interrupt source so that the source holds the interrupt line low until the mcu recognizes and acknowledges the interrupt request. if the interrupt line is held low, the mcu will recognize another interrupt as soon as the interrupt mask bit in the mcu is cleared (normally upon return from an interrupt). 3.5.6 mode select (smodn, moda, and modb) the state of these pins during reset determine the mcu operating mode. after reset, moda and modb can be configured as instruction queue tracking signals ipipe0 and ipipe1. moda and modb have active pull- downs during reset. the smodn pin has an active pull-up when configured as input. this pin can be used as bkgd or taghi after reset. 3.5.7 single-wire background mode pin (bkgd) the bkgd pin receives and transmits serial background debugging commands. a special self-timing protocol is used. the bkgd pin has an active pull-up when configured as input; bkgd has no pull-up control. refer to development support .
pinout and signal descriptions signal descriptions 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 49 3.5.8 external address and data buses (addr[15:0] and data[15:0]) external bus pins share function with general-purpose i/o ports a and b. in single-chip operating modes, the pins can be used for i/o; in expanded modes, the pins are used for the external buses. in expanded wide mode, ports a and b are used for multiplexed 16-bit data and address buses. pa[7:0] correspond to addr[15:8]/data[15:8]; pb[7:0] correspond to addr[7:0]/data[7:0]. in expanded narrow mode, ports a and b are used for the16-bit address bus, and an 8-bit data bus is multiplexed with the most significant half of the address bus on port a. in this mode, 16-bit data is handled as two back-to-back bus cycles, one for the high byte followed by one for the low byte. pa[7:0] correspond to addr[15:8] and to data[15:8] or data[7:0], depending on the bus cycle. the state of the address pin should be latched at the rising edge of e. to allow for maximum address setup time at external devices, a transparent latch should be used. 3.5.9 read/write (r/w ) in all modes this pin can be used as general-purpose i/o and is an input with an active pull-up out of reset. if the read/write function is required it should be enabled by setting the rdwe bit in the pear register. external writes will not be possible until enabled. 3.5.10 low-byte strobe (lstrb) in all modes this pin can be used as general-purpose i/o and is an input with an active pull-up out of reset. if the strobe function is required, it should be enabled by setting the lstre bit in the pear register. this signal is used in write operations and so external low byte writes will not be possible until this function is enabled. this pin is also used as taglo in special expanded modes and is multiplexed with the lstrb function.
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 50 pinout and signal descriptions motorola 3.5.11 instruction queue tracking signals (ipipe1 and ipipe0) these signals are used to track the state of the internal instruction execution queue. execution state is time-multiplexed on the two signals. refer to development support . 3.5.12 data bus enable (dbe ) the dbe pin (pe7) is an active low signal that will be asserted low during e-clock high time. dbe provides separation between output of a multiplexed address and the input of data. when an external address is stretched, dbe is asserted during what would be the last quarter cycle of the last e-clock cycle of stretch. in expanded modes this pin is used to enable the drive control of external buses during external reads. use of the dbe is controlled by the ndbe bit in the pear register.dbe is enabled out of reset in expanded modes. this pin has an active pull-up during and after reset in single chip modes. 3.5.13 inverted e clock (eclk ) the eclk pin (pe7) can be used to latch the address for de- multiplexing. it has the same behavior as the eclk, except is inverted. in expanded modes this pin is used to enable the drive control of external buses during external reads. use of the eclk is controlled by the ndbe and dbene bits in the pear register. 3.5.14 calibration reference (cal) the cal pin (pe7) is the output of the slow mode programmable clock divider, slwclk, and is used as a calibration reference. the slwclk frequency is equal to the crystal frequency out of reset and always has a 50% duty. if the dbe function is enabled it will override the enabled cal output. the cal pin output is disabled by clearing cale bit in the pear register.
pinout and signal descriptions signal descriptions 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 51 3.5.15 clock generation module test (cgmtst) the cgmtst pin (pe6) is the output of the clocks tested when cgmte bit is set in pear register. the pipoe bit must be cleared for the clocks to be tested. table 3-2. 68hc(9)12d60 signal description summary pin name pin number description 80-pin 112-pin extal 35 47 crystal driver and external clock input pins. on reset all the device clocks are derived from the extal input frequency. xtal is the crystal output. xtal 36 48 reset 34 46 an active low bidirectional control signal, reset acts as an input to initialize the mcu to a known start-up state, and an output when cop or clock monitor causes a reset. addr[7:0] data[7:0] 23 ? 16 31 ? 24 external bus pins share function with general-purpose i/o ports a and b. in single chip modes, the pins can be used for i/o. in expanded modes, the pins are used for the external buses. addr[15:8] data[15:8] 48 ? 41 64 ? 57 dbe 25 36 data bus control and, in expanded mode, enables the drive control of external buses during external reads. eclk 25 36 inverted e clock used to latch the address. cal 25 36 cal is the output of the slow mode programmable clock divider, slwclk, and is used as a calibration reference for functions such as time of day. it is overridden when dbe function is enabled. it always has a 50% duty cycle. cgmtst 26 37 clock generation module test output. modb/ ipipe1, moda/ ipipe0 26, 27 37, 38 state of mode select pins during reset determine the initial operating mode of the mcu. after reset, modb and moda can be configured as instruction queue tracking signals ipipe1 and ipipe0 or as general-purpose i/o pins. eclk 28 39 e clock is the output connection for the external bus clock. eclk is used as a timing reference and for address demultiplexing. lstrb / taglo 37 53 low byte strobe (0 = low byte valid), in all modes this pin can be used as i/o. the low strobe function is the exclusive-nor of a0 and the internal sz8 signal. (the sz8 internal signal indicates the size 16/8 access.) pin function taglo used in instruction tagging. see development support . r/w 38 54 indicates direction of data on expansion bus. shares function with general- purpose i/o. read/write in expanded modes. irq 39 55 maskable interrupt request input provides a means of applying asynchronous interrupt requests to the mcu. either falling edge-sensitive triggering or level-sensitive triggering is program selectable (intcr register).
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 52 pinout and signal descriptions motorola xirq 40 56 provides a means of requesting asynchronous nonmaskable interrupt requests after reset initialization smodn/bk gd/taghi 15 23 single-wire background interface pin is dedicated to the background debug function. during reset, this pin determines special or normal operating mode. pin function taghi used in instruction tagging. see development support . pw[3:0] 80, 1 ? 3112, 1 ? 3 pulse width modulator channel outputs. ss 70 96 slave select output for spi master mode, input for slave mode or master mode. sck 69 95 serial clock for spi system. sdo/mosi 68 94 master out/slave in pin for serial peripheral interface sdi/miso 67 93 master in/slave out pin for serial peripheral interface txd1 66 92 sci1 transmit pin rxd1 65 91 sci1 receive pin txd0 64 90 sci0 transmit pin rxd0 63 89 sci0 receive pin ioc[7:0] 14 ? 11, 7 ? 4 18 ? 15, 7 ? 4 pins used for input capture and output compare in the timer and pulse accumulator subsystem. an1[7:0] n/a 84/82/80/78/ 76/74/72/70 analog inputs for the analog-to-digital conversion module 1 an0[7:0] 60 ? 53 83/81/79/77/ 75/73/71/69 analog inputs for the analog-to-digital conversion module 0 txcan 72 104 mscan transmit pin rxcan 73 105 mscan receive pin kwg[6:0] 8 (kwg4 only) 9 ? 11, 19 ? 22 key wake-up and general purpose i/o; can cause an interrupt when an input transitions from high to low. on 80-pin qfp all 8 i/o should be initialised. pgupd (1) 13 defines if i/o port resistive load is a pull-up or a pull-down, when enabled. kwh[7:0] 24 (kwh4 only) 32 ? 35, 49 ? 52 key wake-up and general purpose i/o; can cause an interrupt when an input transitions from high to low. on 80-pin qfp all 8 i/o should be initialised. phupd (2) 41 defines if i/o port resistive load is a pull-up or a pull-down, when enabled. 1. in the 80-pin version pgupd is connected internally to vdd 2. in the 80-pin version phupd is connected internally to vss table 3-2. 68hc(9)12d60 signal description summary pin name pin number description 80-pin 112-pin
pinout and signal descriptions port signals 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 53 3.6 port signals the 68hc(9)12d60 incorporates eight ports which are used to control and access the various device subsystems. when not used for these purposes, port pins may be used for general-purpose i/o. in addition to the pins described below, each port consists of a data register which can be read and written at any time, and, with the exception of port ad0, port ad1 (available only in 112tqfp), pe[1:0], rxcan and txcan, a data direction register which controls the direction of each pin. after reset all general purpose i/o pins are configured as input. 3.6.1 port a port a pins are used for address and data in expanded modes. in single chip modes, the pins can be used as i/o. the port data register is not in the address map during expanded and peripheral mode operation. when it is in the map, port a can be read or written at anytime. register ddra determines whether each port a pin is an input or output. ddra is not in the address map during expanded and peripheral mode operation. setting a bit in ddra makes the corresponding bit in port a an output; clearing a bit in ddra makes the corresponding bit in port a an input. the default reset state of ddra is all zeros. when the pupa bit in the pucr register is set, all port a input pins are pulled-up internally by an active pull-up device. this bit has no effect if the port is being used in expanded modes as the pull-ups are inactive. setting the rdpa bit in register rdriv causes all port a outputs to have reduced drive level. rdriv can be written once after reset. rdriv is not in the address map in peripheral mode. refer to bus control and input/output .
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 54 pinout and signal descriptions motorola 3.6.2 port b port b pins are used for address and data in expanded modes. in single chip modes, the pins can be used as i/o. the port data register is not in the address map during expanded and peripheral mode operation. when it is in the map, port b can be read or written at anytime. register ddrb determines whether each port b pin is an input or output. ddrb is not in the address map during expanded and peripheral mode operation. setting a bit in ddrb makes the corresponding bit in port b an output; clearing a bit in ddrb makes the corresponding bit in port b an input. the default reset state of ddrb is all zeros. when the pupb bit in the pucr register is set, all port b input pins are pulled-up internally by an active pull-up device. this bit has no effect if the port is being used in expanded modes as the pull-ups are inactive. setting the rdpb bit in register rdriv causes all port b outputs to have reduced drive level. rdriv can be written once after reset. rdriv is not in the address map in peripheral mode. refer to bus control and input/output . 3.6.3 port e port e pins operate differently from port a and b pins. port e pins are used for bus control signals and interrupt service request signals. when a pin is not used for one of these specific functions, it can be used as general-purpose i/o. however, two of the pins (pe[1:0]) can only be used for input, and the states of these pins can be read in the port data register even when they are used for irq and xirq . the pear register determines pin function, and register ddre determines whether each pin is an input or output when it is used for general-purpose i/o. pear settings override ddre settings. because pe[1:0] are input-only pins, only ddre[7:2] have effect. setting a bit in the ddre register makes the corresponding bit in port e an output; clearing a bit in the ddre register makes the corresponding bit in port e an input. the default reset state of ddre is all zeros.
pinout and signal descriptions port signals 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 55 when the pupe bit in the pucr register is set, pe7 and pe[3:0] are pulled up by active devices. neither port e nor ddre is in the map in peripheral mode; neither is in the internal map in expanded modes with eme set. setting the rdpe bit in register rdriv causes all port e outputs to have reduced drive level. rdriv can be written once after reset. rdriv is not in the address map in peripheral mode. refer to bus control and input/output . 3.6.4 port g port g pins are used for key wake-ups that can be used with the pins configured as inputs or outputs. the key wake-ups are triggered with a falling edge signal (kwpg). an interrupt is generated if the corresponding bit is enabled (kwieg). if any of the interrupts is not enabled, the corresponding pin can be used as a general purpose i/o pin. refer to i/o ports with key wake-up . register ddrg determines pin direction of port g when used for general-purpose i/o. when ddrg bits are set, the corresponding pin is configured for output. on reset the ddrg bits are cleared and the corresponding pin is configured for input. port pgupd determines what type of resistive load is used for port g input pins when pupg bit is set in the pucr register. when pgupd pin is low, it loads a pull-down in all port g input pins. when pgupd pin is high, it loads a pull-up in all port g input pins. in 80-pin version, the pgupd is connected internally to vdd. the pg4 will have a pull-up. all port g pins should either be defined as outputs or have their pull-ups enabled. setting the rdpg bit in register rdriv causes all port g outputs to have reduced drive level. rdriv can be written once after reset. rdriv is not in the address map in peripheral mode. refer to bus control and input/output .
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 56 pinout and signal descriptions motorola 3.6.5 port h port h pins are used for key wake-ups that can be used with the pins configured as inputs or outputs. the key wake-ups are triggered with a falling edge signal (kwph). an interrupt is generated if the corresponding bit is enabled (kwieh). if any of the interrupts is not enabled, the corresponding pin can be used as a general purpose i/o pin. refer to i/o ports with key wake-up . register ddrh determines pin direction of port h when used for general-purpose i/o. when ddrh bits are set, the corresponding pin is configured for output. on reset the ddrh bits are cleared and the corresponding pin is configured for input. port phupd determines what type of resistive load is used for port h input pins when puph bit is set in the pucr register. when phupd pin is low, it loads a pull-down in all port h input pins. when phupd pin is high, it loads a pull-up in all port h input pins. in 80-pin version, the phupd is connected internally to vss. the ph4 will have a pull-down. all port h pins should either be defined as outputs or have their pull-downs enabled. setting the rdph bit in register rdriv causes all port h outputs to have reduced drive level. rdriv can be written once after reset. rdriv is not in the address map in peripheral mode. refer to bus control and input/output . 3.6.6 port can the mscan12 uses two external pins, one input (rxcan) and one output (txcan). the txcan output pin represents the logic level on the can: ? 0 ? is for a dominant state, and ? 1 ? is for a recessive state. rxcan is on bit 0 of port can, txcan is on bit 1. the remaining six pins of port can, available only in the 112-pin package, are controlled by registers in the mscan12 address space. in 80qfp all portcan[2:7] pins should either be defined as outputs or have their pull-ups enabled.
pinout and signal descriptions port signals 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 57 3.6.7 port ad1 input to the analog-to-digital subsystem and general-purpose input. when analog-to-digital functions are not enabled, the port has eight general-purpose input pins, pad1[7:0]. the adpu bit in the atd1ctl2 register enables the a/d function. port ad1 pins are inputs; no data direction register is associated with this port. the port has no resistive input loads and no reduced drive controls. refer to analog-to-digital converter . port ad1 is not available in the 80-pin package. 3.6.8 port ad0 input to the analog-to-digital subsystem and general-purpose input. when analog-to-digital functions are not enabled, the port has eight general-purpose input pins, pad0[7:0]. the adpu bit in the atd0ctl2 register enables the a/d function. port ad0 pins are inputs; no data direction register is associated with this port. the port has no resistive input loads and no reduced drive controls. refer to analog-to-digital converter . 3.6.9 port p the four pulse-width modulation channel outputs share general-purpose port p pins. the pwm function is enabled with the pwen register. enabling pwm pins takes precedence over the general-purpose port. when pulse-width modulation is not in use, the port pins may be used for general-purpose i/o. register ddrp determines pin direction of port p when used for general-purpose i/o. when ddrp bits are set, the corresponding pin is configured for output. on reset the ddrp bits are cleared and the corresponding pin is configured for input. when the pupp bit in the pwctl register is set, all input pins are pulled up internally by an active pull-up device. pull-ups are disabled after reset.
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 58 pinout and signal descriptions motorola setting the rdpp bit in the pwctl register configures all port p outputs to have reduced drive levels. levels are at normal drive capability after reset. the pwctl register can be read or written anytime after reset. refer to pulse width modulator . 3.6.10 port s port s is the 8-bit interface to the standard serial interface consisting of the two serial communications interfaces (sci1 and sci0) and the serial peripheral interface (spi) subsystems. port s pins are available for general-purpose parallel i/o when standard serial functions are not enabled. port s pins serve several functions depending on the various internal control registers. if woms bit in the sc0cr1register is set, the p- channel drivers of the output buffers are disabled for bits 0 through 1 for the scsi1 (2 through 3 for the sci0). if swom bit in the sp0cr1 register is set, the p-channel drivers of the output buffers are disabled for bits 4 through 7 (wire-ored mode). the open drain control effects to both the serial and the general-purpose outputs. if the rdpsx bits in the purds register are set, the appropriate port s pin drive capabilities are reduced. if pupsx bits in the purds register are set, the appropriate pull-up device is connected to each port s pin which is programmed as a general-purpose input. if the pin is programmed as a general-purpose output, the pull-up is disconnected from the pin regardless of the state of the individual pupsx bits. see multiple serial interface . 3.6.11 port t this port provides eight general-purpose i/o pins when not enabled for input capture and output compare in the timer and pulse accumulator subsystem. the ten bit in the tscr register enables the timer function. the pulse accumulator subsystem is enabled with the paen bit in the pactl register. register ddrt determines pin direction of port t when used for general- purpose i/o. when ddrt bits are set, the corresponding pin is
pinout and signal descriptions port signals 68hc(9)12d60 ? rev 3.0 advance information motorola pinout and signal descriptions 59 configured for output. on reset the ddrt bits are cleared and the corresponding pin is configured for input. when the pupt bit in the tmsk2 register is set, all input pins are pulled up internally by an active pull-up device. pull-ups are disabled after reset. setting the rdpt bit in the tmsk2 register configures all port t outputs to have reduced drive levels. levels are at normal drive capability after reset. the tmsk2 register can be read or written anytime after reset refer to enhanced capture timer .
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 60 pinout and signal descriptions motorola 3.6.12 port pull-up pull-down and reduced drive mcu ports can be configured for internal pull-up. to reduce power consumption and rfi, the pin output drivers can be configured to operate at a reduced drive level. reduced drive causes a slight increase in transition time depending on loading and should be used only for ports which have a light loading. table 3-4 summarizes the port pull-up/pull- down default status and controls. table 3-3 . 68hc(9)12d60 port description summary port name pin numbers data direction register (address) description 80-pin 112-pin port a pa[7:0] 48 ? 41 64 ? 57 in/out ddra ($0002) port a and port b pins are used for address and data in expanded modes. the port data registers are not in the address map during expanded and peripheral mode operation. when in the map, port a and port b can be read or written any time. ddra and ddrb are not in the address map in expanded or peripheral modes. port b pb[7:0] 23 ? 16 31 ? 24 in/out ddrb ($0003) port ad1 pad1[7:0] n/a 84/82/80 /78/76/7 4/72/70 in analog-to-digital converter 1 and general-purpose i/o. port ad0 pad0[7:0] 60 ? 53 83/81/79 /77/75/7 3/71/69 in analog-to-digital converter 0 and general-purpose i/o. port can pcan[7:0] 72, 73 (1) 98 ? 105 in/out general purpose i/o. pcan[1:0] are used with the mscan12 module and cannot be used as i/o. port e pe[7:0] 25 ? 28, 37 ? 40 36 ? 39, 53 ? 56 pe[1:0] in pe[7:2] in/out ddre ($0009) mode selection, bus control signals and interrupt service request signals; or general-purpose i/o. port p pp[7:0] 76 ? 80, 1 ? 3 108 ? 112 , 1 ? 3 in/out ddrp ($0057) general-purpose i/o. pp[3:0] are used with the pulse-width modulator when enabled. port s ps[7:0] 70 ? 63 96 ? 89 in/out ddrs ($00d7) serial communications interfaces 1 and 0 and serial peripheral interface subsystems and general-purpose i/o. port t pt[7:0] 14 ? 11, 7 ? 4 18 ? 15, 7 ? 4 in/out ddrt ($00af) general-purpose i/o when not enabled for input capture and output compare in the timer and pulse accumulator subsystem. 1. in 80-pin qfp package only txcan and rxcan are available. portcan[2:7] pins should either be defined as outputs or have their pull-ups enabled.
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 61 pinout and signal descriptions motorola table 3-4. port pull-up, pull-down and reduced drive summary enable bit reduced drive control bit port name resistive input loads register (address) bit name reset state register (address) bit name reset state port a pull-up pucr ($000c) pupa disabled rdriv ($000d) rdpa full drive port b pull-up pucr ($000c) pupb disabled rdriv ($000d) rdpb full drive port e: pe7, pe[3:2] pull-up pucr ($000c) pupe enabled rdriv ($000d) rdpe full drive pe[1:0] pull-up pucr ($000c) pupe enabled ? pe[6:4] none ? rdriv ($000d) rdpe full drive port g pull-up or pull- down (1) pucr ($000c) pupg enabled rdriv ($000d) rdpg full drive port h pull-up or pull- down (2) pucr ($000c) puph enabled rdriv ($000d) rdph full drive port p pull-up pwcont ($0054) pupp disabled pwcont ($0054) rdpp full drive ps[1:0] pull-up purds ($00d9) pups0 disabled purds ($00db) rdps0 full drive ps[3:2] pull-up purds ($00d9) pups1 disabled purds ($00db) rdps1 full drive ps[7:4] pull-up purds ($00d9) pups2 disabled purds ($00db) rdps2 full drive port t pull-up tmsk2 ($008d) pupt disabled tmsk2 ($008d) tdrb full drive portcan[1]: txcan none ?? portcan[0]: rxcan pull-up always enabled ? port can[7:2] pull-up pctlcan ($013d) pupcan disabled pctlcan ($013d) rdpcan full drive port ad0 none ?? port ad1 none ?? 1. pull-up when pgupd input pin is high, pull-down when pgupd input pin is low. in the 80-pin version, pgupd is internally tied to vdd, hence pg4 is pulled up. 2. pull-up when phupd input pin is high, pull-down when phupd input pin is low. in the 80-pin version, phupd is internally tied to vss, hence ph4 is pulled down.
pinout and signal descriptions advance information 68hc(9)12d60 ? rev 3.0 62 pinout and signal descriptions motorola
68hc(9)12d60 ? rev 3.0 advance information motorola registers 63 advance information ? 68hc(9)12d60 section 4. registers 4.1 contents 4.2 register block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4.2 register block the register block can be mapped to any 2k byte boundary within the standard 64k byte address space by manipulating bits reg[15:11] in the initrg register. initrg establishes the upper five bits of the register block ? s 16-bit address. the register block occupies the first 512 bytes of the 2k byte block. default addressing (after reset) is indicated in table 4-1 . for additional information refer to operating modes and resource mapping .
registers advance information 68hc(9)12d60 ? rev 3.0 64 registers motorola address bit 7 6 5 4 3 2 1 bit 0 name $0000 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 porta (1) $0001 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 portb (1) $0002 dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 ddra (1) $0003 ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 ddrb (1) $000400000000 reserved (3) $000500000000 reserved (3) $000600000000 reserved (3) $000700000000 reserved (3) $0008 pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 porte (2) $0009 dde7 dde6 dde5 dde4 dde3 dde2 0 0 ddre (2) $000a ndbe cgmte pipoe neclk lstre rdwe cale dbene pear (3) $000b smodn modb moda estr ivis ebswai 0 eme mode (3) $000c puph pupg 0 pupe 0 0 pupb pupa pucr (3) $000d 0 rdph rdpg 0 rdpe 0 rdpb rdpa rdriv (3) $000e00000000 reserved (3) $000f00000000 reserved (3) $0010 ram15 ram14 ram13 ram12 ram11 0 0 0 initrm $0011 reg15 reg14 reg13 reg12 reg11 0 0 mmswai initrg $0012 ee15 ee14 ee13 ee12 0 0 0 eeon initee $0013 maprom ndrf rfstr1 rfstr0 exstr1 exstr0 romon28romon32 misc $0014 rtie rswai rsbck reserved rtbyp rtr2 rtr1 rtr0 rtictl $0015rtif0000000rtiflg $0016 cme fcme fcmcop wcop disr cr2 cr1 cr0 copctl $0017 bit 7 6 5 4 3 2 1 bit 0 coprst $001800000000reserved $001900000000reserved $001a 0 0 0 0 0 0 0 0 reserved $001b 0 0 0 0 0 0 0 0 reserved $001c00000000reserved $001d00000000reserved $001e irqe irqen dly 0 0 0 0 0 intcr $001f 1 1 psel5 psel4 psel3 psel2 psel1 0 hprio $0020 bken1 bken0 bkpm 0 bk1ale bk0ale 0 0 brkct0 $0021 0 bkdbe bkmbh bkmbl bk1rwe bk1rw bk0rwe bk0rw brkct1 $0022 bit 15 14 13 12 11 10 9 bit 8 brkah table 4-1. 68hc(9)12d60 register map (sheet 1 of 8)
registers register block 68hc(9)12d60 ? rev 3.0 advance information motorola registers 65 $0023 bit 7 6 5 4 3 2 1 bit 0 brkal $0024 bit 15 14 13 12 11 10 9 bit 8 brkdh $0025 bit 7 6 5 4 3 2 1 bit 0 brkdl $002600000000reserved $002700000000reserved $0028 pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 portg $0029 ph7 ph6 ph5 ph4 ph3 ph2 ph1 ph0 porth $002a ddg7 ddg6 ddg5 ddg4 ddg3 ddg2 ddg1 ddg0 ddrg $002b ddh7 ddh6 ddh5 ddh4 ddh3 ddh2 ddh1 ddh0 ddrh $002c wi2ce kwieg6kwieg5kwieg4kwieg3kwieg2kwieg1kwieg0 kwieg $002d kwieh7 kwieh6 kwieh5 kwieh4 kwieh3 kwieh2 kwieh1 kwieh0 kwieh $002e 0 kwifg6 kwifg5 kwifg4 kwifg3 kwifg2 kwifg1 kwifg0 kwifg $002f kwifh7 kwifh6 kwifh5 kwifh4 kwifh3 kwifh2 kwifh1 kwifh0 kwifh $0030 ? $ 0037 unimplemented (4) reserved $0038 0 0 syn5 syn4 syn3 syn2 syn1 syn0 synr $0039 0 0 0 0 0 refdv2 refdv1 refdv0 refdv $003a 0 0 0 0 0 0 0 0 reserved $003b lockif lock 0 0 0 0 lhif lhome pllflg $003c lockie pllon auto acq 0 pstp lhie nolhm pllcr $003d 0 bcsp bcss 0 0 mcs 0 0 clksel $003e 0 0 sldv5 sldv4 sldv3 sldv2 sldv1 sldv0 slow $003f00000000reserved $0040 con23 con01 pcka2 pcka1 pcka0 pckb2 pckb1 pckb0 pwclk $0041 pclk3 pclk2 pclk1 pclk0 ppol3 ppol2 ppol1 ppol0 pwpol $0042 0 0 0 0 pwen3 pwen2 pwen1 pwen0 pwen $0043 0 bit 6 5 4 3 2 1 bit 0 pwpres $0044 bit 7 6 5 4 3 2 1 bit 0 pwscal0 $0045 bit 7 6 5 4 3 2 1 bit 0 pwscnt0 $0046 bit 7 6 5 4 3 2 1 bit 0 pwscal1 $0047 bit 7 6 5 4 3 2 1 bit 0 pwscnt1 $0048 bit 7 6 5 4 3 2 1 bit 0 pwcnt0 $0049 bit 7 6 5 4 3 2 1 bit 0 pwcnt1 $004abit 7654321bit 0pwcnt2 $004bbit 7654321bit 0pwcnt3 $004c bit 7 6 5 4 3 2 1 bit 0 pwper0 $004d bit 7 6 5 4 3 2 1 bit 0 pwper1 $004ebit 7654321bit 0pwper2 address bit 7 6 5 4 3 2 1 bit 0 name table 4-1. 68hc(9)12d60 register map (sheet 2 of 8)
registers advance information 68hc(9)12d60 ? rev 3.0 66 registers motorola $004f bit 7 6 5 4 3 2 1 bit 0 pwper3 $0050 bit 7 6 5 4 3 2 1 bit 0 pwdty0 $0051 bit 7 6 5 4 3 2 1 bit 0 pwdty1 $0052 bit 7 6 5 4 3 2 1 bit 0 pwdty2 $0053 bit 7 6 5 4 3 2 1 bit 0 pwdty3 $0054 0 0 0 pswai centr rdpp pupp psbck pwctl $0055 discr discp discal 0 0 0 0 0 pwtst $0056 pp7 pp6 pp5 pp4 pp3 pp2 pp1 pp0 portp $0057 ddp7 ddp6 ddp5 ddp4 ddp3 ddp2 ddp1 ddp0 ddrp $005800000000reserved $005900000000reserved $005a 0 0 0 0 0 0 0 0 reserved $005b 0 0 0 0 0 0 0 0 reserved $005c00000000reserved $005d00000000reserved $005e 0 0 0 0 0 0 0 0 reserved $005f00000000reserved $0060 reserved atd0ctl0 $0061 atd0ctl1 $0062 adpu affc awai 0 0 0 ascie ascif atd0ctl2 $0063 0 0 0 0 0 0 frz1 frz0 atd0ctl3 $0064 s10bm smp1 smp0 prs4 prs3 prs2 prs1 prs0 atd0ctl4 $0065 0 s8cm scan mult cd cc cb ca atd0ctl5 $0066 scf 0 0 0 0 cc2 cc1 cc0 atd0stat0 $0067 ccf7 ccf6 ccf5 ccf4 ccf3 ccf2 ccf1 ccf0 atd0stat1 $0068 sar9 sar8 sar7 sar6 sar5 sar4 sar3 sar2 atd0test h $0069 sar1 sar0 rst tstout tst3 tst2 tst1 tst0 atd0testl $006a ? $ 006e 00000000reserved $006f pad07 pad06 pad05 pad04 pad03 pad02 pad01 pad00 portad0 $0070 bit 15 14 13 12 11 10 9 bit 8 adr00h $0071 bit 7 bit 6 0 0 0 0 0 0 adr00l $0072 bit 15 14 13 12 11 10 9 bit 8 adr01h $0073 bit 7 bit 6 0 0 0 0 0 0 adr01l $0074 bit 15 14 13 12 11 10 9 bit 8 adr02h $0075 bit 7 bit 6 0 0 0 0 0 0 adr02l $0076 bit 15 14 13 12 11 10 9 bit 8 adr03h $0077 bit 7 bit 6 0 0 0 0 0 0 adr03l address bit 7 6 5 4 3 2 1 bit 0 name table 4-1. 68hc(9)12d60 register map (sheet 3 of 8)
registers register block 68hc(9)12d60 ? rev 3.0 advance information motorola registers 67 $0078 bit 15 14 13 12 11 10 9 bit 8 adr04h $0079 bit 7 bit 6 0 0 0 0 0 0 adr04l $007a bit 15 14 13 12 11 10 9 bit 8 adr05h $007b bit 7 bit 6 0 0 0 0 0 0 adr05l $007c bit 15 14 13 12 11 10 9 bit 8 adr06h $007d bit 7 bit 6 0 0 0 0 0 0 adr06l $007e bit 15 14 13 12 11 10 9 bit 8 adr07h $007f bit 7 bit 6 0 0 0 0 0 0 adr07l $0080 ios7 ios6 ios5 ios4 ios3 ios2 ios1 ios0 tios $0081 foc7 foc6 foc5 foc4 foc3 foc2 foc1 foc0 cforc $0082 oc7m7 oc7m6 oc7m5 oc7m4 oc7m3 oc7m2 oc7m1 oc7m0 oc7m $0083 oc7d7 oc7d6 oc7d5 oc7d4 oc7d3 oc7d2 oc7d1 oc7d0 oc7d $0084 bit 15 14 13 12 11 10 9 bit 8 tcnt $0085 bit 7 6 5 4 3 2 1 bit 0 tcnt $0086 ten tswai tsbck tffca reserved tscr $0087 reserved tqcr $0088 om7 ol7 om6 ol6 om5 ol5 om4 ol4 tctl1 $0089 om3 ol3 om2 ol2 om1 ol1 om0 ol0 tctl2 $008a edg7b edg7a edg6b edg6a edg5b edg5a edg4b edg4a tctl3 $008b edg3b edg3a edg2b edg2a edg1b edg1a edg0b edg0a tctl4 $008c c7i c6i c5i c4i c3i c2i c1i c0i tmsk1 $008d toi 0 pupt rdpt tcre pr2 pr1 pr0 tmsk2 $008e c7f c6f c5f c4f c3f c2f c1f c0f tflg1 $008ftof0000000tflg2 $0090 bit 15 14 13 12 11 10 9 bit 8 tc0 $0091 bit 7 6 5 4 3 2 1 bit 0 tc0 $0092 bit 15 14 13 12 11 10 9 bit 8 tc1 $0093 bit 7 6 5 4 3 2 1 bit 0 tc1 $0094 bit 15 14 13 12 11 10 9 bit 8 tc2 $0095 bit 7 6 5 4 3 2 1 bit 0 tc2 $0096 bit 15 14 13 12 11 10 9 bit 8 tc3 $0097 bit 7 6 5 4 3 2 1 bit 0 tc3 $0098 bit 15 14 13 12 11 10 9 bit 8 tc4 $0099 bit 7 6 5 4 3 2 1 bit 0 tc4 $009a bit 15 14 13 12 11 10 9 bit 8 tc5 $009bbit 7654321bit 0tc5 $009c bit 15 14 13 12 11 10 9 bit 8 tc6 $009d bit 7 6 5 4 3 2 1 bit 0 tc6 address bit 7 6 5 4 3 2 1 bit 0 name table 4-1. 68hc(9)12d60 register map (sheet 4 of 8)
registers advance information 68hc(9)12d60 ? rev 3.0 68 registers motorola $009e bit 15 14 13 12 11 10 9 bit 8 tc7 $009f bit 7 6 5 4 3 2 1 bit 0 tc7 $00a0 0 paen pamod pedge clk1 clk0 paovi pai pactl $00a1000000paovfpaifpaflg $00a2bit 7654321bit 0pacn3 $00a3bit 7654321bit 0pacn2 $00a4bit 7654321bit 0pacn1 $00a5bit 7654321bit 0pacn0 $00a6 mczi modmc rdmcl iclat flmc mcen mcpr1 mcpr0 mcctl $00a7 mczf 0 0 0 polf3 polf2 polf1 polf0 mcflg $00a8 0 0 0 0 pa3en pa2en pa1en pa0en icpacr $00a9000000dly1dly0dlyct $00aa novw7 novw6 novw5 novw4 novw3 novw2 novw1 novw0 icovw $00ab sh37 sh26 sh15 sh04 tfmod pacmx bufen latq icsys $00ac 0 0 0 0 0 0 0 0 reserved $00ad 0 0 0 0 0 0 tcbyp 0 timtst $00ae pt7 pt6 pt5 pt4 pt3 pt2 pt1 pt0 portt $00af ddt7 ddt6 ddt5 ddt4 ddt3 ddt2 ddt1 ddt0 ddrt $00b0 0 pben 0 0 0 0 pbovi 0 pbctl $00b1 0 0 0 0 0 0 pbovf 0 pbflg $00b2bit 7654321bit 0pa3h $00b3bit 7654321bit 0pa2h $00b4bit 7654321bit 0pa1h $00b5bit 7654321bit 0pa0h $00b6 bit 15 14 13 12 11 10 9 bit 8 mccnth $00b7 bit 7 6 5 4 3 2 1 bit 0 mccntl $00b8 bit 15 14 13 12 11 10 9 bit 8 tc0h $00b9bit 7654321bit 0tc0h $00ba bit 15 14 13 12 11 10 9 bit 8 tc1h $00bbbit 7654321bit 0tc1h $00bc bit 15 14 13 12 11 10 9 bit 8 tc2h $00bd bit 7 6 5 4 3 2 1 bit 0 tc2h $00be bit 15 14 13 12 11 10 9 bit 8 tc3h $00bf bit 7 6 5 4 3 2 1 bit 0 tc3h $00c0 btst bspl brld sbr12 sbr11 sbr10 sbr9 sbr8 sc0bdh $00c1 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 sc0bdl $00c2 loops woms rsrc m wake ilt pe pt sc0cr1 $00c3 tie tcie rie ilie te re rwu sbk sc0cr2 address bit 7 6 5 4 3 2 1 bit 0 name table 4-1. 68hc(9)12d60 register map (sheet 5 of 8)
registers register block 68hc(9)12d60 ? rev 3.0 advance information motorola registers 69 $00c4 tdre tc rdrf idle or nf fe pf sc0sr1 $00c5 scswai mie mdl1 mdl0 0 0 0 raf sc0sr2 $00c6 r8 t8 0 0 0 0 0 0 sc0drh $00c7 r7/t7 r6/t6 r5/t5 r4/t4 r3/t3 r2/t2 r1/t1 r0/t0 sc0drl $00c8 btst bspl brld sbr12 sbr11 sbr10 sbr9 sbr8 sc1bdh $00c9 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 sc1bdl $00ca loops woms rsrc m wake ilt pe pt sc1cr1 $00cb tie tcie rie ilie te re rwu sbk sc1cr2 $00cc tdre tc rdrf idle or nf fe pf sc1sr1 $00cd scswai 0 0 0 0 0 0 raf sc1sr2 $00ce r8 t8 0 0 0 0 0 0 sc1drh $00cf r7/t7 r6/t6 r5/t5 r4/t4 r3/t3 r2/t2 r1/t1 r0/t0 sc1drl $00d0 spie spe swom mstr cpol cpha ssoe lsbf sp0cr1 $00d1 0 0 0 0 0 0 spswai spc0 sp0cr2 $00d2 0 0 0 0 0 spr2 spr1 spr0 sp0br $00d3 spif wcol 0 modf 0 0 0 0 sp0sr $00d4 0 0 0 0 0 0 0 0 reserved $00d5 bit 7 6 5 4 3 2 1 bit 0 sp0dr $00d6 ps7 ps6 ps5 ps4 ps3 ps2 ps1 ps0 ports $00d7 dds7 dds6 dds5 dds4 dds3 dds2 dds1 dds0 ddrs $00d8 0 0 0 0 0 0 0 0 reserved $00d9 0 rdps2 rdps1 rdps0 0 pups2 pups1 pups0 purds $00da ? $00df 0 0 0 0 0 0 0 0 reserved $00e0 ? $00ef unimplemented (4) reserved $00f0 nobdml noshb reserved 1 eeswai protlck eerc eemcr $00f1 shprot 1 1 bprot4 bprot3 bprot2 bprot1 bprot0 eeprot $00f200000000reserved $00f3 bulkp 0 0 byte row erase eelat eepgm eeprog $00f4 (5) 0000000lockfee32lck $00f5 (5) 0000000bootpfee32mcr $00f6 (5) fste gadr hvt fenlv fdisvfp vtck stre mwpr feetst $00f7 (5) 0 0 0 feeswai svfp eras lat enpe fee32ctl $00f8 (5) 0000000lockfee28lck $00f9 (5) 0000000bootpfee28mcr $00fa (5) fste gadr hvt fenlv fdisvfp vtck stre mwpr feetst address bit 7 6 5 4 3 2 1 bit 0 name table 4-1. 68hc(9)12d60 register map (sheet 6 of 8)
registers advance information 68hc(9)12d60 ? rev 3.0 70 registers motorola $00fb (5) 0 0 0 feeswai svfp eras lat enpe fee28ctl $00fc ? $00ff unimplemented (4) reserved $0100 0 0 cswai synch tlnken slpak slprq sftres cmcr0 $0101 0 0 0 0 0 loopb wupm clksrc cmcr1 $0102 sjw1 sjw0 brp5 brp4 brp3 brp2 brp1 brp0 cbtr0 $0103 samp tseg22 tseg21 tseg20 tseg13 tseg12 tseg11 tseg10 cbtr1 $0104 wupif rwrnif twrnif rerrif terrif boffif ovrif rxf crflg $0105 wupie rwrnie twrnie rerrie terrie boffie ovrie rxfie crier $0106 0 abtak2 abtak1 abtak0 0 txe2 txe1 txe0 ctflg $0107 0 abtrq2 abtrq1 abtrq0 0 txeie2 txeie1 txeie0 ctcr $0108 0 0 idam1 idam0 0 idhit2 idhit1 idhit0 cidac $0109 ? $010d unimplemented (4) reserved $010e rxerr7 rxerr6 rxerr5 rxerr4 rxerr3 rxerr2 rxerr1 rxerr0 crxerr $010f txerr7 txerr6 txerr5 txerr4 txerr3 txerr2 txerr1 txerr0 ctxerr $0110 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar0 $0111 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar1 $0112 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar2 $0113 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar3 $0114 am7 am6 am5 am4 am3 am2 am1 am0 cidmr0 $0115 am7 am6 am5 am4 am3 am2 am1 am0 cidmr1 $0116 am7 am6 am5 am4 am3 am2 am1 am0 cidmr2 $0117 am7 am6 am5 am4 am3 am2 am1 am0 cidmr3 $0118 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar4 $0119 ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar5 $011a ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar6 $011b ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 cidar7 $011c am7 am6 am5 am4 am3 am2 am1 am0 cidmr4 $011d am7 am6 am5 am4 am3 am2 am1 am0 cidmr5 $011e am7 am6 am5 am4 am3 am2 am1 am0 cidmr6 $011f am7 am6 am5 am4 am3 am2 am1 am0 cidmr7 $0120 ? $013c unimplemented (4) reserved $013d000000pupcanrdpcanpctlcan $013e pcan7 pcan6 pcan5 pcan4 pcan3 pcan2 txcan rxcan portcan $013f ddcan7 ddcan6 ddcan5 ddcan4 ddcan3 ddcan2 0 0 ddrcan $0140 ? $014f receive buffer rxfg address bit 7 6 5 4 3 2 1 bit 0 name table 4-1. 68hc(9)12d60 register map (sheet 7 of 8)
registers register block 68hc(9)12d60 ? rev 3.0 advance information motorola registers 71 $0150 ? $015f transmit buffer 0 tx0 $0160 ? $016f transmit buffer 1 tx1 $0170 ? $017f transmit buffer 2 tx2 $0180 ? $01df unimplemented (4) reserved $01e0 reserved atd1ctl0 $01e1 reserved atd1ctl1 $01e2 adpu affc awai 0 0 0 ascie ascif atd1ctl2 $01e3000000frz1frz0atd1ctl3 $01e4 s10bm smp1 smp0 prs4 prs3 prs2 prs1 prs0 atd1ctl4 $01e5 0 s8cm scan mult cd cc cb ca atd1ctl5 $01e6 scf 0 0 0 0 cc2 cc1 cc0 atd1stat0 $01e7 ccf7 ccf6 ccf5 ccf4 ccf3 ccf2 ccf1 ccf0 atd1stat1 $01e8 sar9 sar8 sar7 sar6 sar5 sar4 sar3 sar2 atd1testh $01e9 sar1 sar0 rst tstout tst3 tst2 tst1 tst0 atd1testl $01ea ? $ 01ee 0 0 0 0 0 0 0 0 reserved $01ef pad17 pad16 pad15 pad14 pad13 pad12 pad11 pad10 portad1 $01f0 bit 15 14 13 12 11 10 9 bit 8 adr10h $01f1 bit 7 bit 6 0 0 0 0 0 0 adr10l $01f2 bit 15 14 13 12 11 10 9 bit 8 adr11h $01f3bit 7bit 6000000adr11l $01f4 bit 15 14 13 12 11 10 9 bit 8 adr12h $01f5 bit 7 bit 6 0 0 0 0 0 0 adr12l $01f6 bit 15 14 13 12 11 10 9 bit 8 adr13h $01f7 bit 7 bit 6 0 0 0 0 0 0 adr13l $01f8 bit 15 14 13 12 11 10 9 bit 8 adr14h $01f9 bit 7 bit 6 0 0 0 0 0 0 adr14l $01fa bit 15 14 13 12 11 10 9 bit 8 adr15h $01fb bit 7 bit 6 0 0 0 0 0 0 adr15l $01fc bit 15 14 13 12 11 10 9 bit 8 adr16h $01fd bit 7 bit 6 0 0 0 0 0 0 adr16l $01fe bit 15 14 13 12 11 10 9 bit 8 adr17h $01ff bit 7 bit 6 0 0 0 0 0 0 adr17l = reserved or unimplemented bits. address bit 7 6 5 4 3 2 1 bit 0 name table 4-1. 68hc(9)12d60 register map (sheet 8 of 8)
registers advance information 68hc(9)12d60 ? rev 3.0 72 registers motorola 1. port a, port b and data direction registers ddra, ddrb are not in map in expanded and peripheral modes. 2. port e and ddre not in map in peripheral mode; also not in map in expanded modes with eme set. 3. registers also not in map in peripheral mode. 4. data read at these locations is undefined. 5. available on 68hc912d60 only. registers are unimplemented on 68hc12d60 - data read at these locations is undefined.
68hc(9)12d60 ? rev 3.0 advance information motorola operating modes and resource mapping 73 advance information ? 68hc(9)12d60 section 5. operating modes and resource mapping 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 5.3 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 5.4 background debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 5.5 internal resource mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5.6 memory maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 5.2 introduction eight possible operating modes determine the operating configuration of the 68hc(9)12d60. each mode has an associated default memory map and external bus configuration. after reset, most system resources can be mapped to other addresses by writing to the appropriate control registers. 5.3 operating modes the operating mode out of reset is determined by the states of the bkgd, modb, and moda pins during reset. the smodn, modb, and moda bits in the mode register show current operating mode and provide limited mode switching during operation.
operating modes and resource mapping advance information 68hc(9)12d60 ? rev 3.0 74 operating modes and resource mapping motorola the states of the bkgd, modb, and moda pins are latched into these bits on the rising edge of the reset signal. there are two basic types of operating modes: normal modes ? some registers and bits are protected against accidental changes. special modes ? allow greater access to protected control registers and bits for special purposes such as testing and emulation. for operation above 105 c, the 68hc(9)12d60 (m temperature range product only) is limited to single chip modes of operation. a system development and debug feature, background debug mode (bdm), is available in all modes. in special single-chip mode, bdm is active immediately after reset. 5.3.1 normal operating modes these modes provide three operating configurations. background debugging is available in all three modes, but must first be enabled for some operations by means of a bdm background command, then activated. table 5-1. mode selection bkgd modb moda mode port a port b 1 0 0 normal single chip g.p. i/o g.p. i/o 1 0 1 normal expanded narrow addr/data addr 110 reserved (forced to peripheral) ?? 1 1 1 normal expanded wide addr/data addr/data 0 0 0 special single chip g.p. i/o g.p. i/o 0 0 1 special expanded narrow addr/data addr 0 1 0 special peripheral addr/data addr/data 0 1 1 special expanded wide addr/data addr/data
operating modes and resource mapping operating modes 68hc(9)12d60 ? rev 3.0 advance information motorola operating modes and resource mapping 75 normal single-chip mode ? there are no external address and data buses in this mode. the mcu operates as a stand- alone device and all program and data resources are on-chip. external port pins normally associated with address and data buses can be used for general-purpose i/o. normal expanded wide mode ? this is a normal mode of operation in which the expanded bus is present with a 16-bit data bus. ports a and b are used for the 16-bit multiplexed address/data bus. normal expanded narrow mode ? this is a normal mode of operation in which the expanded bus is present with an 8-bit data bus. ports a and b are used for the16-bit address bus. port a is used as the data bus, multiplexed with addresses. in this mode, 16-bit data is presented one byte at a time, the high byte followed by the low byte. the address is automatically incremented on the second cycle. 5.3.2 special operating modes there are three special operating modes that correspond to normal operating modes. these operating modes are commonly used in factory testing and system development. in addition, there is a special peripheral mode, in which an external master, such as an i.c. tester, can control the on-chip peripherals. special single-chip mode ? this mode can be used to force the mcu to active bdm mode to allow system debug through the bkgd pin. there are no external address and data buses in this mode. the mcu operates as a stand-alone device and all program and data space are on-chip. external port pins can be used for general-purpose i/o. special expanded wide mode ? this mode can be used for emulation of normal expanded wide mode and emulation of normal single-chip mode. ports a and b are used for the 16-bit multiplexed address/data bus.
operating modes and resource mapping advance information 68hc(9)12d60 ? rev 3.0 76 operating modes and resource mapping motorola special expanded narrow mode ? this mode can be used for emulation of normal expanded narrow mode. ports a and b are used for the16-bit address bus. port a is used as the data bus, multiplexed with addresses. in this mode, 16-bit data is presented one byte at a time, the high byte followed by the low byte. the address is automatically incremented on the second cycle. special peripheral mode ? the cpu is not active in this mode. an external master can control on-chip peripherals for testing purposes. it is not possible to change to or from this mode without going through reset. background debugging should not be used while the mcu is in special peripheral mode as internal bus conflicts between bdm and the external master can cause improper operation of both modes. 5.4 background debug mode background debug mode (bdm) is an auxiliary operating mode that is used for system development. bdm is implemented in on-chip hardware and provides a full set of debug operations. some bdm commands can be executed while the cpu is operating normally. other bdm commands are firmware based, and require the bdm firmware to be enabled and active for execution. in special single-chip mode, bdm is enabled and active immediately out of reset. bdm is available in all other operating modes, but must be enabled before it can be activated. bdm should not be used in special peripheral mode because of potential bus conflicts. once enabled, background mode can be made active by a serial command sent via the bkgd pin or execution of a cpu12 bgnd instruction. while background mode is active, the cpu can interpret special debugging commands, and read and write cpu registers, peripheral registers, and locations in memory. while bdm is active, the cpu executes code located in a small on-chip rom mapped to addresses $ff20 to $ffff, and bdm control registers are accessible at addresses $ff00 to $ff06. the bdm rom replaces
operating modes and resource mapping background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola operating modes and resource mapping 77 the regular system vectors while bdm is active. while bdm is active, the user memory from $ff00 to $ffff is not in the map except through serial bdm commands. mode controls the mcu operating mode and various configuration options. this register is not in the map in peripheral mode smodn, modb, moda ? mode select special, b and a these bits show the current operating mode and reflect the status of the bkgd, modb and moda input pins at the rising edge of reset. smodn is read anytime. may only be written in special modes (smodn = 0). the first write is ignored; modb, moda may be written once in normal modes (smodn = 1). write anytime in special modes (first write is ignored) ? special peripheral and reserved modes cannot be selected. bit 7654321bit 0 smodn modb moda estr ivis ebswai 0 eme reset: 00011001special single chip reset: 00111001special exp nar reset: 01011001 peripheral reset: 01111001special exp wide reset: 10010000normal single chip reset: 10110000normal exp nar reset: 11110000normal exp wide mode ? mode register $000b
operating modes and resource mapping advance information 68hc(9)12d60 ? rev 3.0 78 operating modes and resource mapping motorola estr ? e clock stretch enable determines if the e clock behaves as a simple free-running clock or as a bus control signal that is active only for external bus cycles. estr is always 1 in expanded modes since it is required for address and data bus de-multiplexing and must follow stretched cycles. 0 = e never stretches (always free running). 1 = e stretches high during external access cycles and low during non-visible internal accesses (ivis=0). normal modes: write once; special modes: write anytime. read anytime. ivis ? internal visibility this bit determines whether internal addr, data, r/w and lstrb signals can be seen on the external bus during accesses to internal locations. in special narrow mode if this bit is set and an internal access occurs the data will appear wide on ports a and b. this serves the same function as the emd bit of the non-multiplexed versions of the hc12 and allows for emulation. visibility is not available when the part is operating in a single-chip mode. 0 = no visibility of internal bus operations on external bus. 1 = internal bus operations are visible on external bus. normal modes: write once; special modes: write anytime except the first time. read anytime. ebswai ? external bus module stop in wait control this bit controls access to the external bus interface when in wait mode. the module will delay before shutting down in wait mode to allow for final bus activity to complete. 0 = external bus and registers continue functioning during wait mode. 1 = external bus is shut down during wait mode. normal modes: write anytime; special modes: write never. read anytime.
operating modes and resource mapping internal resource mapping 68hc(9)12d60 ? rev 3.0 advance information motorola operating modes and resource mapping 79 eme ? emulate port e in single-chip mode porte and ddre are always in the map regardless of the state of this bit. 0 = porte and ddre are in the memory map. 1 = if in an expanded mode, porte and ddre are removed from the internal memory map. removing the registers from the map allows the user to emulate the function of these registers externally. normal modes: write once; special modes: write anytime except the first time. read anytime. 5.5 internal resource mapping the internal register block, ram, and eeprom have default locations within the 64k byte standard address space but may be reassigned to other locations during program execution by setting bits in mapping registers initrg, initrm, and initee. during normal operating modes these registers can be written once. it is advisable to explicitly establish these resource locations during the initialization phase of program execution, even if default values are chosen, in order to protect the registers from inadvertent modification later. writes to the mapping registers go into effect between the cycle that follows the write and the cycle after that. to assure that there are no unintended operations, a write to one of these registers should be followed with a nop instruction. if conflicts occur when mapping resources, the register block will take precedence over the other resources; ram or eeprom addresses occupied by the register block will not be available for storage. when active, bdm rom takes precedence over other resources, although a conflict between bdm rom and register space is not possible. the following table shows resource mapping precedence. in expanded modes, all address space not used by internal resources is by default external memory. the 68hc912d60 contains 60k bytes of flash eeprom nonvolatile memory which can be used to store program code or static data. it is
operating modes and resource mapping advance information 68hc(9)12d60 ? rev 3.0 80 operating modes and resource mapping motorola made of the 28k byte fee28 array mapped from $1000 to $7fff at reset and of the 32 k byte fee32 array mapped from $8000 to $ffff at reset. maprom bit in the misc register allows the swapping of the two flash arrays. the 68hc12d60 contains 60k bytes of rom memory. it is made of a 28k byte array mapped from $1000 to $7fff and a 32 k byte array mapped from $8000 to $ffff at reset. the maprom bit in the misc register allows the swapping of the two arrays. table 5-2. mapping precedence precedence resource 1 bdm rom (if active) 2 register space 3ram 4eeprom 5 on-chip flash eeprom (68hc912d60) rom (68hc12d60) 6 external memory
operating modes and resource mapping internal resource mapping 68hc(9)12d60 ? rev 3.0 advance information motorola operating modes and resource mapping 81 5.5.1 register block mapping after reset the 512 byte register block resides at location $0000 but can be reassigned to any 2k byte boundary within the standard 64k byte address space. mapping of internal registers is controlled by five bits in the initrg register. the register block occupies the first 512 bytes of the 2k byte block. reg[15:11] ? internal register map position these bits specify the upper five bits of the 16-bit registers address. normal modes: write once; special modes: write anytime. read anytime. mmswai ? memory mapping interface stop in wait control this bit controls access to the memory mapping interface when in wait mode. normal modes: write anytime; special modes: write never. read anytime. 0 = memory mapping interface continues to function during wait mode. 1 = memory mapping interface access is shut down during wait mode. bit 7654321bit 0 reg15reg14reg13reg12reg11 0 0 mmswai reset: 00000000 initrg ? initialization of internal register position register $0011
operating modes and resource mapping advance information 68hc(9)12d60 ? rev 3.0 82 operating modes and resource mapping motorola 5.5.2 ram mapping the 68hc(9)12d60 has 2k byte of fully static ram that is used for storing instructions, variables, and temporary data during program execution. after reset, ram addressing begins at location $0000 but can be assigned to any 2k byte boundary within the standard 64k byte address space. mapping of internal ram is controlled by five bits in the initrm register. after reset, the first 512 bytes of ram have their access inhibited by the presence of the register address space. after initial mcu configuration, it is recommended to map the register space at location $0800. ram[15:11] ? internal ram map position these bits specify the upper five bits of the 16-bit ram address. normal modes: write once; special modes: write anytime. read anytime. bit 7654321bit 0 ram15 ram14 ram13 ram12 ram11 0 0 0 reset: 00000000 initrm ? initialization of internal ram position register $0010
operating modes and resource mapping internal resource mapping 68hc(9)12d60 ? rev 3.0 advance information motorola operating modes and resource mapping 83 5.5.3 eeprom mapping the 68hc(9)12d60 has 1k bytes of eeprom which is activated by the eeon bit in the initee register. mapping of internal eeprom is controlled by four bits in the initee register. after reset eeprom address space begins at location $0c00 but can be mapped to any 4k byte boundary within the standard 64k byte address space. ee[15:12] ? internal eeprom map position these bits specify the upper four bits of the 16-bit eeprom address. normal modes: write once; special modes: write anytime. read anytime. eeon ? internal eeprom on (enabled) this bit is forced to one in single-chip modes. read or write anytime. 0 = removes the eeprom from the map. 1 = places the on-chip eeprom in the memory map at the address selected by ee[15:12]. bit 7654321bit 0 ee15 ee14 ee13 ee12 0 0 0 eeon reset: 00000001 initee ? initialization of internal eeprom position register $0012
operating modes and resource mapping advance information 68hc(9)12d60 ? rev 3.0 84 operating modes and resource mapping motorola 5.5.4 miscellaneous system control register additional mapping and external resource controls are available. to use external resources the part must be operated in one of the expanded modes. normal modes: write once; special modes: write anytime. read anytime. maprom ? map location of rom this bit is used to swap the location of the on-chip flash eeprom (68hc912d60) or rom (68hc12d60) arrays. 0 = 28k byte array is mapped from $1000 to $7fff, 32k byte array is mapped from $8000 to $ffff. 1 = 28k byte is mapped from $9000 to $ffff, 32k byte array is mapped from $0000 to $7fff. ndrf ? narrow data bus for register-following map space this bit enables a narrow bus feature for the 512 byte register- following map. this is useful for accessing 8-bit peripherals and allows 8-bit and 16-bit external memory devices to be mixed in a system. in expanded narrow (eight bit) modes, single chip modes, and peripheral mode, this bit has no effect. 0 = makes register-following map space act as a full 16 bit data bus. 1 = makes the register-following map space act the same as an 8 bit only external data bus (data only goes through port a externally). the register-following space is mapped from $0200 to $03ff after reset, which is next to the register map. if the registers are moved this space follows. bit 7654321bit 0 maprom ndrf rfstr1 rfstr0 exstr1 exstr0 romon28 romon32 reset: 0 0001100exp modes reset: 0 0001111sc modes misc ? miscellaneous mapping control register $0013
operating modes and resource mapping internal resource mapping 68hc(9)12d60 ? rev 3.0 advance information motorola operating modes and resource mapping 85 rfstr1, rfstr0 ? register following stretch this two bit field determines the amount of clock stretch on accesses to the 512 byte register following map. it is valid regardless of the state of the ndrf bit. in single chip and peripheral modes this bit has no meaning or effect. exstr1, exstr0 ? external access stretch this two bit field determines the amount of clock stretch on accesses to the external address space. in single chip and peripheral modes this bit has no meaning or effect. romon28, romon32 ? enable bits for rom these bits are used to enable the flash eeprom arrays fee28 and fee32 (68hc912d60) or rom arrays rom28 and rom32 (68hc12d60) respectively. 0 = corresponding flash eeprom/rom array disabled from the memory map. 1 = corresponding flash eeprom/rom array enabled in the memory map. table 5-3. rfstr stretch bit definition rfstr1 rfstr0 number of e clocks stretched 00 0 01 1 10 2 11 3 table 5-4. exstr stretch bit definition exstr1 exstr0 number of e clocks stretched 00 0 01 1 10 2 11 3
operating modes and resource mapping advance information 68hc(9)12d60 ? rev 3.0 86 operating modes and resource mapping motorola 5.6 memory maps the following diagrams illustrate the memory map for each mode of operation immediately after reset . figure 5-1 . 68hc(9)12d60 memory map $01ff registers (mappable to any 2k space) 2k bytes ram (mappable to any 2k space) expanded normal single chip special single chip $0000 $07ff $0000 1k bytes eeprom (mappable to any 4k space) $0fff $0c00 vectors vectors bdm (if active) $ffff $ff00 28k flash eeprom (fee28) * or 28k rom (rom28) $ $7fff $1000 $ffff $8000 32k flash eeprom (fee32) * or 32k rom (rom32) $ $e000 - $ffff protected boot ext $6000 - $7fff protected boot $0000 $0800 $0c00 $1000 $8000 $ff00 $ffff $0200 vectors * 68hc912d60 $ 68hc12d60
68hc(9)12d60 ? rev 3.0 advance information motorola bus control and input/output 87 advance information ? 68hc(9)12d60 section 6. bus control and input/output 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 6.3 detecting access type from external signals . . . . . . . . . . . . .87 6.4 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 6.2 introduction internally the 68hc(9)12d60 has full 16-bit data paths, but depending upon the operating mode and control registers, the external multiplexed bus may be 8 or 16 bits. there are cases where 8-bit and 16-bit accesses can appear on adjacent cycles using the lstrb signal to indicate 8- or 16-bit data. it is possible to have a mix of 8 and 16 bit peripherals attached to the external multiplexed bus, using the ndrf bit in the misc register while in expanded wide modes. 6.3 detecting access type from external signals the external signals lstrb , r/w , and a0 can be used to determine the type of bus access that is taking place. accesses to the internal ram module are the only type of access that produce lstrb =a0=1, because the internal ram is specifically designed to allow misaligned 16-bit accesses in a single cycle. in these cases the data for the address
bus control and input/output advance information 68hc(9)12d60 ? rev 3.0 88 bus control and input/output motorola that was accessed is on the low half of the data bus and the data for address + 1 is on the high half of the data bus. 6.4 registers not all registers are visible in the 68hc(9)12d60 memory map under certain conditions. in special peripheral mode the first 16 registers associated with bus expansion are removed from the memory map. in expanded modes, some or all of port a, port b, and port e are used for expansion buses and control signals. in order to allow emulation of the single-chip functions of these ports, some of these registers must be rebuilt in an external port replacement unit. in any expanded mode, port a, and port b, are used for address and data lines so registers for these ports, as well as the data direction registers for these ports, are removed from the on-chip memory map and become external accesses. in any expanded mode, port e pins may be needed for bus control (e.g., eclk, r/w ). to regain the single-chip functions of port e, the emulate port e (eme) control bit in the mode register may be set. in this special case of expanded mode and eme set, porte and ddre registers are removed from the on-chip memory map and become external accesses so port e may be rebuilt externally. figure 6-1. access type vs. bus control pins lstrb a0 r/w type of access 1 0 1 8-bit read of an even address 0 1 1 8-bit read of an odd address 1 0 0 8-bit write of an even address 0 1 0 8-bit write of an odd address 0 0 1 16-bit read of an even address 111 16-bit read of an odd address (low/high data swapped) 0 0 0 16-bit write to an even address 110 16-bit write to an even address (low/high data swapped)
bus control and input/output registers 68hc(9)12d60 ? rev 3.0 advance information motorola bus control and input/output 89 bits pa[7:0] are associated respectively with addresses addr[15:8], data[15:8] and data[7:0], in narrow mode. when this port is not used for external addresses such as in single-chip mode, these pins can be used as general-purpose i/o. ddra determines the primary direction of each pin. this register is not in the on-chip map in expanded and peripheral modes. read and write anytime. this register determines the primary direction for each port a pin when functioning as a general-purpose i/o port. ddra is not in the on-chip map in expanded and peripheral modes. read and write anytime. 0 = associated pin is a high-impedance input 1 = associated pin is an output bit 7654321bit 0 single chip pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 reset: ???????? expanded & periph: addr15/ data15 addr14/ data14 addr13/ data13 addr12/ data12 addr11/ data11 addr10/ data10 addr9/ data9 addr8/ data8 expanded narrow addr15/ data15/ data7 addr14/ data14/ data6 addr13/ data13/ data5 addr12/ data12/ data4 addr11/ data11/ data3 addr10/ data10/ data2 addr9/ data9/ data1 addr8/ data8/ data0 porta ? port a register $0000 bit 7654321bit 0 dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 reset: 0 0 0 0 0 0 0 0 ddra ? port a data direction register $0002
bus control and input/output advance information 68hc(9)12d60 ? rev 3.0 90 bus control and input/output motorola bits pb[7:0] are associated with addresses addr[7:0] and data[7:0] (except in narrow mode) respectively. when this port is not used for external addresses such as in single-chip mode, these pins can be used as general-purpose i/o. ddrb determines the primary direction of each pin. this register is not in the on-chip map in expanded and peripheral modes. read and write anytime. this register determines the primary direction for each port b pin when functioning as a general-purpose i/o port. ddrb is not in the on-chip map in expanded and peripheral modes. read and write anytime. 0 = associated pin is a high-impedance input 1 = associated pin is an output bit 7654321bit 0 single chip pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 reset: ???????? expanded & periph: addr7/ data7 addr6/ data6 addr5/ data5 addr4/ data4 addr3/ data3 addr2/ data2 addr1/ data1 addr0/ data0 expanded narrow addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 portb ? port b register $0001 bit 7654321bit 0 ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 reset: 0 0 0 0 0 0 0 0 ddrb ? port b data direction register $0003
bus control and input/output registers 68hc(9)12d60 ? rev 3.0 advance information motorola bus control and input/output 91 this register is associated with external bus control signals and interrupt inputs, including data bus enable (dbe ), mode select (modb/ipipe1, moda/ipipe0), e clock, size (lstrb ), read/write (r/w ), irq , and xirq . when the associated pin is not used for one of these specific functions, the pin can be used as general-purpose i/o. the port e assignment register (pear) selects the function of each pin. ddre determines the primary direction of each port e pin when configured to be general-purpose i/o. some of these pins have software selectable pull-ups (dbe , lstrb , r/w , irq , and xirq ). a single control bit enables the pull-ups for all these pins which are configured as inputs. this register is not in the map in peripheral mode or expanded modes when the eme bit is set. read and write anytime. this register determines the primary direction for each port e pin configured as general-purpose i/o. bit 7654321bit 0 pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 reset: ???????? alt. pin function dbe or eclk or cal modb or ipipe1 or cgmtst moda or ipipe0 eclk lstrb or bdtagl or taglo r/w irq xirq porte ? port e register $0008 bit 7654321bit 0 dde7 dde6 dde5 dde4 dde3 dde2 0 0 reset: 0 0 000000 ddre ? port e data direction register $0009
bus control and input/output advance information 68hc(9)12d60 ? rev 3.0 92 bus control and input/output motorola 0 = associated pin is a high-impedance input 1 = associated pin is an output pe[1:0] are associated with xirq and irq and cannot be configured as outputs. these pins can be read regardless of whether the alternate interrupt functions are enabled. this register is not in the map in peripheral mode and expanded modes while the eme control bit is set. read and write anytime. the pear register is used to choose between the general-purpose i/o functions and the alternate bus control functions of port e. when an alternate control function is selected, the associated ddre bits are overridden. the reset condition of this register depends on the mode of operation because bus-control signals are needed immediately after reset in some modes. in normal single-chip mode, no external bus control signals are needed so all of port e is configured for general-purpose i/o. bit 7654321bit 0 ndbe cgmte pipoe neclk lstre rdwe cale dbene reset: 0 0 0 0 0 0 0 0 normal expanded reset: 0 0 1 0 1 1 0 0 special expanded reset: 1 1 0 1 0 0 0 0 peripheral reset: 1 0 0 1 0 0 0 0 normal single chip reset: 0 0 1 0 1 1 0 0 special single chip pear ? port e assignment register $000a
bus control and input/output registers 68hc(9)12d60 ? rev 3.0 advance information motorola bus control and input/output 93 in normal expanded modes, the reset vector is located in external memory. the dbe and e clock are required for de-multiplexing address and data, but lstrb and r/w are only needed by the system when there are external writable resources. therefore in normal expanded modes, only the dbe and e clock are configured for their alternate bus control functions and the other bits of port e are configured for general- purpose i/o. if the normal expanded system needs any other bus-control signals, pear would need to be written before any access that needed the additional signals. in special expanded modes, dbe , ipipe1, ipipe0, e, lstrb , and r/w are configured as bus-control signals. in peripheral mode, the pear register is not accessible for reads or writes. however, the cgmte control bit is reset to one to configure pe6 as a test output from the pll module. ndbe ? no data bus enable normal: write once; special: write anytime except the first. read anytime. 0 = pe7 is used for dbe , external control of data enable on memories, or inverted e clock. 1 = pe7 is the cal function if cale bit is set in pear register or general-purpose i/o. ndbe controls the use of the dbe pin of port e. the ndbe bit has no effect in single chip or peripheral modes. the associated pin will default to the cal function if the cale bit is set in pear register or otherwise to an i/o. cgmte ? clock generator module testing enable normal: write never; special: write anytime except the first. read anytime. 0 = pe6 is general-purpose i/o or pipe output. 1 = pe6 is a test signal output from the cgm module (no effect in single chip or normal expanded modes). pipoe = 1 overrides this function and forces pe6 to be a pipe status output signal.
bus control and input/output advance information 68hc(9)12d60 ? rev 3.0 94 bus control and input/output motorola pipoe ? pipe status signal output enable normal: write once; special: write anytime except the first time. read anytime. 0 = pe[6:5] are general-purpose i/o (if cgmte = 1, pe6 is a test output signal from the cgm module). 1 = pe[6:5] are outputs and indicate the state of the instruction queue (only effective in expanded modes). neclk ? no external e clock normal single chip: write once; special single chip: write anytime; all other modes: write never. read anytime. in peripheral mode, e is an input and in all other modes, e is an output. 0 = pe4 is the external e-clock pin subject to the following limitation: in single-chip modes, to get an e clock output signal, it is necessary to have estr = 0 in addition to neclk = 0. 1 = pe4 is a general-purpose i/o pin. lstre ? low strobe (lstrb ) enable normal: write once; special: write anytime except the first time. read anytime. this bit has no effect in single-chip modes or normal expanded narrow mode. 0 = pe3 is a general-purpose i/o pin. 1 = pe3 is configured as the lstrb bus-control output, provided the mcu is not in single chip or normal expanded narrow modes. lstrb is used during external writes. after reset in normal expanded mode, lstrb is disabled. if needed, it should be enabled before external writes. external reads do not normally need lstrb because all 16 data bits can be driven even if the mcu only needs 8 bits of data. in normal expanded narrow mode this pin is reset to an output driving high allowing the pin to be an output while in and immediately after reset. taglo is a shared function of the pe3/lstrb pin. in special expanded modes with lstre set and the bdm tagging on, a zero at the falling edge of e tags the instruction word low byte being read into the instruction queue.
bus control and input/output registers 68hc(9)12d60 ? rev 3.0 advance information motorola bus control and input/output 95 rdwe ? read/write enable normal: write once; special: write anytime except the first time. read anytime. this bit has no effect in single-chip modes. 0 = pe2 is a general-purpose i/o pin. 1 = pe2 is configured as the r/w pin. in single chip modes, rdwe has no effect and pe2 is a general-purpose i/o pin. r/w is used for external writes. after reset in normal expanded mode, it is disabled. if needed it should be enabled before any external writes. cale ? calibration reference enable read and write anytime. 0 = calibration reference is disabled and pe7 is general-purpose i/o in single chip or peripheral modes or if the ndbe bit is set. 1 = calibration reference is enabled on pe7 in single chip and peripheral modes or if the ndbe bit is set. dbene ? dbe or inverted e clock on port e[7] normal modes: write once. special modes: write anytime except the first; read anytime. dbene controls which signal is output on pe7 when ndbe control bit is cleared. the inverted e clock output can be used to latch the address for demultiplexing. it has the same behaviour as the e clock, except it is inverted. please note that in the case of idle expansion bus, the ? not e clock ? signal could stay high for many cycles. the dbne bit has no effect in single chip or peripheral modes and pe7 is defaulted to the cal function if the cale bit is set in the pear register or to an i/o otherwise. 0 = pe7 pin used for dbe external control of data enable on memories in expanded modes when ndbe = 0 1 = pe7 pin used for inverted e clock output in expanded modes when ndbe = 0
bus control and input/output advance information 68hc(9)12d60 ? rev 3.0 96 bus control and input/output motorola these bits select pull-up resistors for any pin in the corresponding port that is currently configured as an input. this register is not in the map in peripheral mode. read and write anytime. puph ? pull-up or pull-down port h enable 0 = port h pull-ups are disabled. 1 = enable pull-up/down devices for all port h input pins. pupg ? pull-up or pull-down port g enable 0 = port g pull-ups are disabled. 1 = enable pull-up/down devices for all port g input pins. pupe ? pull-up port e enable 0 = port e pull-ups on pe7 and pe[3:0] are disabled. 1 = enable pull-up devices for port e input pins pe7 and pe[3:0]. pupb ? pull-up port b enable 0 = port b pull-ups are disabled. 1 = enable pull-up devices for all port b input pins. this bit has no effect if port b is being used as part of the address/data bus (the pull-ups are inactive). pupa ? pull-up port a enable 0 = port a pull-ups are disabled. 1 = enable pull-up devices for all port a input pins. this bit has no effect if port a is being used as part of the address/data bus (the pull-ups are inactive). bit 7654321bit 0 puph pupg 0 pupe 0 0 pupb pupa reset: 1 1 010000 pucr ? pull-up control register $000c
bus control and input/output registers 68hc(9)12d60 ? rev 3.0 advance information motorola bus control and input/output 97 these bits select reduced drive for the associated port pins. this gives reduced power consumption and reduced rfi with a slight increase in transition time (depending on loading). the reduced drive function is independent of which function is being used on a particular port. this register is not in the map in peripheral mode. normal: write once; special: write anytime except the first time. read anytime. rdph ? reduced drive of port h 0 = all port h output pins have full drive enabled. 1 = all port h output pins have reduced drive capability. rdpg ? reduced drive of port g 0 = all port g output pins have full drive enabled. 1 = all port g output pins have reduced drive capability. rdpe ? reduced drive of port e 0 = all port e output pins have full drive enabled. 1 = all port e output pins have reduced drive capability. rdpb ? reduced drive of port b 0 = all port b output pins have full drive enabled. 1 = all port b output pins have reduced drive capability. rdpa ? reduced drive of port a 0 = all port a output pins have full drive enabled. 1 = all port a output pins have reduced drive capability. bit 7654321bit 0 0 rdph rdpg 0 rdpe 0 rdpb rdpa reset: 0 0 0 0 0 0 0 0 rdriv ? reduced drive of i/o lines $000d
bus control and input/output advance information 68hc(9)12d60 ? rev 3.0 98 bus control and input/output motorola
68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 99 advance information ? 68hc(9)12d60 section 7. flash memory 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.3 overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 7.4 flash eeprom control block . . . . . . . . . . . . . . . . . . . . . . . . 100 7.5 flash eeprom arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 7.6 flash eeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.7 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 7.8 programming the flash eeprom . . . . . . . . . . . . . . . . . . . . . 108 7.9 erasing the flash eeprom . . . . . . . . . . . . . . . . . . . . . . . . . .111 7.10 program/erase protection interlocks . . . . . . . . . . . . . . . . . . .113 7.11 stop or wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 7.2 introduction the two flash eeprom modules (32-kbyte and 28-kbyte) for the 68hc912d60 serve as electrically erasable and programmable, non- volatile rom emulation memory. the modules can be used for program code that must either execute at high speed or is frequently executed, such as operating system kernels and standard subroutines, or they can be used for static data which is read frequently. the flash eeprom is ideal for program storage for single-chip applications allowing for field reprogramming.
flash memory advance information 68hc(9)12d60 ? rev 3.0 100 flash memory motorola 7.3 overview the flash eeprom array is arranged in a 16-bit configuration and may be read as either bytes, aligned words or misaligned words. access time is one bus cycle for byte and aligned word access and two bus cycles for misaligned word operations. the flash eeprom module requires an external program/erase voltage (v fp ) to program or erase the flash eeprom array. the external program/erase voltage is provided to the flash eeprom module via an external v fp pin. to prevent damage to the flash array, v fp should always be within the specification as defined in table 20-10 in electrical specifications . programming is by byte or aligned word. the flash eeprom module supports bulk erase only. the flash eeprom module has hardware interlocks which protect stored data from accidental corruption. an erase- and program- protected 8-kbyte block for boot routines is located at $6000 ? $7fff or $e000 ? $ffff depending upon the mapped location of the flash eeprom arrays. 7.4 flash eeprom control block a 4-byte register block for each module controls the flash eeprom module operation. configuration information is specified and programmed independently from the contents of the flash eeprom array. at reset, the 4-byte register section starts at address $00f4/$00f8. 7.5 flash eeprom arrays after reset, the 32k flash eeprom array is located from addresses $8000 to $ffff and the 28k flash eeprom array is from $1000 to $7fff. in expanded modes, the flash eeprom arrays are turned off. the flash eeprom can be mapped to an alternate address range. see operating modes and resource mapping .
flash memory flash eeprom registers 68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 101 7.6 flash eeprom registers in normal modes the lock bit can only be written once after reset. lock ? lock register bit 0 = enable write to feexxmcr register 1 = disable write to feexxmcr register this register controls the operation of the flash eeprom array. bootp cannot be changed when the lock control bit in the feexxlck register is set or if enpe in the feexxctl register is set. bootp ? boot protect the boot blocks are located at $6000 ? $7fff and $e000 ? $ffff for each flash eeprom module. 0 = enable erase and program of 8k byte boot block 1 = disable erase and program of 8k byte boot block bit 7654321bit 0 0000000lock reset: 0 0 000000 fee32lck/fee28lck ? flash eeprom lock control register $00f4/$00f8 bit 7654321bit 0 0000000bootp reset: 0 0 000001 fee32mcr/fee28mcr ? flash eeprom module configuration register $00f5/$00f9
flash memory advance information 68hc(9)12d60 ? rev 3.0 102 flash memory motorola in normal mode, writes to feetst control bits have no effect and always read zero. the flash eeprom module cannot be placed in test mode inadvertently during normal operation. fste ? stress test enable 0 = disables the gate/drain stress circuitry 1 = enables the gate/drain stress circuitry gadr ? gate/drain stress test select 0 = selects the drain stress circuitry 1 = selects the gate stress circuitry hvt ? stress test high voltage status 0 = high voltage not present during stress test 1 = high voltage present during stress test fenlv ? enable low voltage 0 = disables low voltage transistor in current reference circuit 1 = enables low voltage transistor in current reference circuit fdisvfp ? disable status v fp voltage lock when the v fp pin is below normal programming voltage the flash module will not allow writing to the lat bit; the user cannot erase or program the flash module. the fdisvfp control bit enables writing to the lat bit regardless of the voltage on the v fp pin. 0 = enable the automatic lock mechanism if v fp is low 1 = disable the automatic lock mechanism if v fp is low bit 7654321bit 0 fste gadr hvt fenlv fdisvfp vtck stre mwpr reset:00000000 fee32tst/fee28tst ? flash eeprom module test register $00f6/$00fa
flash memory flash eeprom registers 68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 103 vtck ? v t check test enable when vtck is set, the flash eeprom module uses the v fp pin to control the control gate voltage; the sense amp time-out path is disabled. this allows for indirect measurements of the bit cells program and erase threshold. if v fp < v zbrk (breakdown voltage) the control gate will equal the v fp voltage. if v fp > v zbrk the control gate will be regulated by the following equation: vcontrol gate = v zbrk + 0.44 (v fp ? v zbrk ) 0 = v t test disable 1 = v t test enable stre ? spare test row enable the spare test row consists of one flash eeprom array row. the reserved word at location 31 contains production test information which must be maintained through several erase cycles. when stre is set, the decoding for the spare test row overrides the address lines which normally select the other rows in the array. 0 = lib accesses are to the flash eeprom array 1 = spare test row in array enabled if smod is active mwpr ? multiple word programming used primarily for testing, if mpwr = 1, the two least-significant address lines addr[1:0] will be ignored when programming a flash eeprom location. the word location addressed if addr[1:0] = 00, along with the word location addressed if addr[1:0] = 10, will both be programmed with the same word data from the programming latches. this bit should not be changed during programming. 0 = multiple word programming disabled 1 = program 32 bits of data
flash memory advance information 68hc(9)12d60 ? rev 3.0 104 flash memory motorola this register controls the programming and erasure of the flash eeprom. feeswai ? flash eeprom stop in wait control 0 = do not halt flash eeprom clock when the part is in wait mode. 1 = halt flash eeprom clock when the part is in wait mode. note: the feeswai bit cannot be asserted if the interrupt vector resides in the flash eeprom array. svfp ? status v fp voltage svfp is a read only bit. 0 = voltage of v fp pin is below normal programming voltage levels 1 = voltage of v fp pin is above normal programming voltage levels eras ? erase control this bit can be read anytime or written when enpe = 0. when set, all locations in the array will be erased at the same time. the boot block will be erased only if bootp = 0. this bit also affects the result of attempted array reads. see table 7-1 for more information. status of eras cannot change if enpe is set. 0 = flash eeprom configured for programming 1 = flash eeprom configured for erasure lat ? latch control this bit can be read anytime or written when enpe = 0. when set, the flash eeprom is configured for programming or erasure and, upon the next valid write to the array, the address and data will be latched for the programming sequence. see table 7-1 for the effects of lat bit 7654321bit 0 0 0 0 feeswai svfp eras lat enpe reset: 0 0 0 0 0 0 0 0 fee32ctl/fee28ctl ? flash eeprom control register $00f7/$00fb
flash memory operation 68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 105 on array reads. a high voltage detect circuit on the v fp pin will prevent assertion of the lat bit when the programming voltage is at normal levels. 0 = programming latches disabled 1 = programming latches enabled enpe ? enable programming/erase 0 = disables program/erase voltage to flash eeprom 1 = applies program/erase voltage to flash eeprom enpe can be asserted only after lat has been asserted and a write to the data and address latches has occurred. if an attempt is made to assert enpe when lat is negated, or if the latches have not been written to after lat was asserted, enpe will remain negated after the write cycle is complete. the lat, eras and bootp bits cannot be changed when enpe is asserted. a write to feexxctl may only affect the state of enpe. attempts to read a flash eeprom array location in the flash eeprom module while enpe is asserted will not return the data addressed. see table 7-1 for more information. flash eeprom module control registers may be read or written while enpe is asserted. if enpe is asserted and lat is negated on the same write access, no programming or erasure will be performed. 7.7 operation the flash eeprom can contain program and data. on reset, it can operate as a bootstrap memory to provide the cpu with internal initialization information during the reset sequence. table 7-1. effects of enpe, lat and eras on array reads enpe lat eras result of read 00 ? normal read of location addressed 0 1 0 read of location being programmed 0 1 1 normal read of location addressed 1 ?? read cycle is ignored
flash memory advance information 68hc(9)12d60 ? rev 3.0 106 flash memory motorola 7.7.1 bootstrap operation single-chip mode after reset, the cpu controlling the system will begin booting up by fetching the first program address from address $fffe. 7.7.2 normal operation the flash eeprom allows a byte or aligned word read/write in one bus cycle. misaligned word read/write require an additional bus cycle. the flash eeprom array responds to read operations only. write operations are ignored. 7.7.3 program/erase operation an unprogrammed flash eeprom bit has a logic state of one. a bit must be programmed to change its state from one to zero. erasing a bit returns it to a logic one. the flash eeprom has a minimum program/erase life of 100 cycles. programming or erasing the flash eeprom is accomplished by a series of control register writes and a write to a set of programming latches. programming is restricted to a single byte or aligned word at a time as determined by internal signal sz8 and addr[0]. the flash eeprom must first be completely erased prior to programming final data values. it is possible to program a location in the flash eeprom without erasing the entire array if the new value does not require the changing of bit values from zero to one. read/write accesses during program/erase ? during program or erase operations, read and write accesses may be different from those during normal operation and are affected by the state of the control bits in the flash eeprom control register (feexxctl). the next write to any valid address to the array after lat is set will cause the address and data to be latched into the programming latches. once the address and data are latched, write accesses to the array will be ignored while lat is set. writes to the control registers will occur normally. program/erase verification ? when programming or erasing the flash eeprom array, a special verification method is required to ensure
flash memory operation 68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 107 that the program/erase process is reliable, and also to provide the longest possible life expectancy. this method requires stopping the program/erase sequence at periods of t ppulse (t epulse for erasing) to determine if the flash eeprom is programmed/erased. after the location reaches the proper value, it must continue to be programmed/erased with additional margin pulses to ensure that it will remain programmed/erased. failure to provide the margin pulses could lead to corrupted or unreliable data. program/erase sequence ? to begin a program or erase sequence the external v fp voltage must be applied and stabilized. the eras bit must be set or cleared, depending on whether a program sequence or an erase sequence is to occur. the lat bit will be set to cause any subsequent data written to a valid address within the flash eeprom to be latched into the programming address and data latches. the next flash array write cycle must be either to the location that is to be programmed if a programming sequence is being performed, or, if erasing, to any valid flash eeprom array location. writing the new address and data information to the flash eeprom is followed by assertion of enpe to turn on the program/erase voltage to program/erase the new location(s). the lat bit must be asserted and the address and data latched to allow the setting of the enpe control bit. if the data and address have not been latched, an attempt to assert enpe will be ignored and enpe will remain negated after the write cycle to feexxctl is completed. the lat bit must remain asserted and the eras bit must remain in its current state as long as enpe is asserted. a write to the lat bit to clear it while enpe is set will be ignored. that is, after the write cycle, lat will remain asserted. likewise, an attempt to change the state of eras will be ignored and the state of the eras bit will remain unchanged. the programming software is responsible for all timing during a program sequence. this includes the total number of program pulses (n pp ), the length of the program pulse (t ppulse ), the program margin pulses (p m ) and the delay between turning off the high voltage and verifying the operation (t vprog ). the erase software is responsible for all timing during an erase sequence. this includes the total number of erase pulses (e m ), the
flash memory advance information 68hc(9)12d60 ? rev 3.0 108 flash memory motorola length of the erase pulse (t epulse ), the erase margin pulse or pulses, and the delay between turning off the high voltage and verifying the operation (t verase ). software also controls the supply of the proper program/erase voltage to the v fp pin, and should be at the proper level before enpe is set during a program/erase sequence. a program/erase cycle should not be in progress when starting another program/erase, or while attempting to read from the array. note: although clearing enpe disables the program/erase voltage (v fp ) from the v fp pin to the array, care must be taken to ensure that v fp is at v dd whenever programming/erasing is not in progress. not doing so could damage the part. ensuring that v fp is always greater or equal to v dd can be accomplished by controlling the v fp power supply with the programming software via an output pin. alternatively, all programming and erasing can be done prior to installing the device on an application circuit board which can always connect v fp to v dd . programming can also be accomplished by plugging the board into a special programming fixture which provides program/erase voltage to the v fp pin. 7.8 programming the flash eeprom programming the flash eeprom is accomplished by the following sequence. the v fp pin voltage must be at the proper level prior to executing step 4 the first time. 1. apply program/erase voltage to the v fp pin. 2. clear eras and set the lat bit in the feexxctl register to establish program mode and enable programming address and data latches. 3. write data to a valid address. the address and data is latched. if bootp is asserted, an attempt to program an address in the boot block will be ignored. 4. apply programming voltage by setting enpe. 5. delay for one programming pulse (t ppulse ).
flash memory programming the flash eeprom 68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 109 6. remove programming voltage by clearing enpe. 7. delay while high voltage is turning off (t vprog ). 8. read the address location to verify that it has been programmed  if the location is not programmed, repeat steps 4 through 7 until the location is programmed or until the specified maximum number of program pulses has been reached (n pp )  if the location is programmed, repeat the same number of pulses as required to program the location. this provides 100% program margin. 9. read the address location to verify that it remains programmed. 10. clear lat. 11. if there are more locations to program, repeat steps 2 through 10. 12. turn off v fp (reduce voltage on v fp pin to v dd ). the flowchart in figure 7-1 demonstrates the recommended programming sequence.
flash memory advance information 68hc(9)12d60 ? rev 3.0 110 flash memory motorola figure 7-1. program sequence flow start prog set lat clear eras write data to address set enpe read get next address/data no location failed location clear margin flag increment n pp counter no decrement n pp counter no yes yes yes to program turn on v fp delay for duration of program pulse (t ppulse ) clear enpe delay before verify is margin flag set? no yes no yes data correct? set margin flag data correct? n pp = 0? done? turn off v fp (t vprog ) n pp = 50? yes no done prog clear program pulse counter (n pp ) clear lat
flash memory erasing the flash eeprom 68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 111 7.9 erasing the flash eeprom the following sequence demonstrates the recommended procedure for erasing the flash eeprom. the v fp pin voltage must be at the proper level prior to executing step 4 the first time. 1. turn on v fp (apply program/erase voltage to the v fp pin). 2. set the lat bit and eras bit to configure the flash eeprom for erasing. 3. write to any valid address in the flash array. this allows the erase voltage to be turned on; the data written and the address written are not important. the boot block will be erased only if the control bit bootp is negated. 4. apply erase voltage by setting enpe. 5. delay for a single erase pulse (t epulse ). 6. remove erase voltage by clearing enpe. 7. delay while high voltage is turning off (t verase ). 8. read the entire array to ensure that the flash eeprom is erased.  if all of the flash eeprom locations are not erased, repeat steps 4 through 7 until either the remaining locations are erased, or until the maximum erase pulses have been applied (n ep )  if all of the flash eeprom locations are erased, repeat the same number of pulses as required to erase the array. this provides 100% erase margin. 9. read the entire array to ensure that the flash eeprom is erased. 10. clear lat. 11. turn off v fp (reduce voltage on v fp pin to v dd ). the flowchart in figure 7-2 demonstrates the recommended erase sequence.
flash memory advance information 68hc(9)12d60 ? rev 3.0 112 flash memory motorola figure 7-2. erase sequence flow start erase set lat set eras write to array set enpe read no array failed to erase array clear margin flag increment n ep counter decrement n ep counter no yes yes turn on v fp delay for duration of erase pulse (t epulse ) clear enpe delay before verify is margin flag set? no yes no yes array erased? set margin flag n ep = 0? turn off v fp (t verase ) n ep = 5? yes no array erased clear erase pulse counter (n ep ) clear lat array erased?
flash memory program/erase protection interlocks 68hc(9)12d60 ? rev 3.0 advance information motorola flash memory 113 7.10 program/erase protection interlocks the flash eeprom program and erase mechanisms provide maximum protection from accidental programming or erasure. the voltage required to program/erase the flash eeprom (v fp ) is supplied via an external pin. if v fp is not present, no programming/erasing will occur. furthermore, the program/erase voltage will not be applied to the flash eeprom unless turned on by setting a control bit (enpe). the enpe bit may not be set unless the programming address and data latches have been written previously with a valid address. the latches may not be written unless enabled by setting a control bit (lat). the lat and enpe control bits must be written on separate writes to the control register (feexxctl) and must be separated by a write to the programming latches. the eras and lat bits are also protected when enpe is set. this prevents inadvertent switching between erase/program mode and also prevents the latched data and address from being changed after a program cycle has been initiated. 7.11 stop or wait mode when stop or wait commands are executed, the mcu puts the flash eeprom in stop or wait mode. in these modes the flash module will cease erasure or programming immediately. it is advised not to enter stop or wait modes when programming the flash array. caution: the flash eeprom module requires a 250nsec delay for wake-up from stop mode. if the operating bus frequency is greater than 4mhz, the flash cannot be used when recovering from stop mode when the dly bit in the intcr register is cleared.
flash memory advance information 68hc(9)12d60 ? rev 3.0 114 flash memory motorola
68hc(9)12d60 ? rev 3.0 advance information motorola eeprom memory 115 advance information ? 68hc(9)12d60 section 8. eeprom memory 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 8.3 future eeprom support . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 8.4 eeprom programmer ? s model . . . . . . . . . . . . . . . . . . . . . . . 117 8.5 eeprom control registers . . . . . . . . . . . . . . . . . . . . . . . . . . 118 8.2 introduction the 68hc(9)12d60 eeprom nonvolatile memory is arranged in a 16- bit configuration. the eeprom array may be read as either bytes, aligned words or misaligned words. access times are one bus cycle for byte and aligned word access and two bus cycles for misaligned word operations. programming is by byte or aligned word. attempts to program or erase misaligned words will fail. only the lower byte will be latched and programmed or erased. programming and erasing of the user eeprom can be done in all modes. each eeprom byte or aligned word must be erased before programming. the eeprom module supports byte, aligned word, row (32 bytes) or bulk erase, all using the internal charge pump. the erased state is $ff. the eeprom module has hardware interlocks which protect stored data from corruption by accidentally enabling the program/erase voltage. programming voltage is derived from the internal v dd supply with an internal charge pump.
eeprom memory advance information 68hc(9)12d60 ? rev 3.0 116 eeprom memory motorola 8.3 future eeprom support design is underway to introduce an improved eeprom module with integrated state machine to simplify programming and erase. this will be introduced on the 68hc912d60a together with 5v programming flash eeprom. appendix: 68hc912d60a eeprom contains detailed information to assist in software planning for future eeprom compatibility and transition to the 68hc912d60a. read, write and erase algorithms are fully compatible with the present eeprom design. the key change comes in the form of a self timed state machine for erasing & writing data. this is implemented using a pre-scaler loaded from a new word register eediv ($00ee) - located in a presently unused location this register can be written without effect, reading the location will return unpredictable data. adding 5 bytes of initialisation code to current software to load eediv (with value appropriate for the application ? s crystal frequency, extali) will help ensure compatibility. other new features for performance improvement are disabled at reset providing a compatible algorithm for modifying the eeprom. caution: other areas for consideration include: program/erase is not guaranteed in limp home mode. clock monitor cme bit must be enabled during program/erase. program/erase should not be performed with input clock frequency <250 khz. resonator/crystal frequency tolerance should be better than 2% total for < 2mhz, 3% total for >= 2mhz. successive writes to an eeprom location must be preceded by an erase cycle. to ensure full compatibility it is recommended that all of appendix: 68hc912d60a eeprom be reviewed.
eeprom memory eeprom programmer ? s model 68hc(9)12d60 ? rev 3.0 advance information motorola eeprom memory 117 8.4 eeprom programmer ? s model the eeprom module consists of two separately addressable sections. the first is a four-byte memory mapped control register block used for control, testing and configuration of the eeprom array. the second section is the eeprom array itself. at reset, the four-byte register section starts at address $00f0 and the eeprom array is located from addresses $0c00 to $0fff. for information on re-mapping the register block and eeprom address space, refer to operating modes and resource mapping . read/write access to the memory array section can be enabled or disabled by the eeon control bit in the initee register. this feature allows the access to memory mapped resources with lower priority than the eeprom memory array. eeprom control registers can be accessed regardless of the state of eeon. any eeprom erase or program operations already in progress will not be affected by modifying eeon. using the normal eeprog control, it is possible to continue program/erase operations during wait. for lowest power consumption during wait, stop program/erase by turning off eepgm. if the stop mode is entered during programming or erasing, program/erase voltage will be automatically turned off and the rc clock (if enabled) is stopped. however, the eepgm control bit will remain set. when stop mode is terminated, the program/erase voltage will be automatically turned back on if eepgm is set. at low bus frequencies, the rc clock must be turned on for program/erase. the eeprom module contains an extra byte called shadow byte which is loaded at reset into the eemcr register. to program the shadow byte, when in special modes (smodn=0), the noshb bit in eemcr register must be cleared. normal programming routines are used to program the shadow byte which becomes accessible at address $0fc0 when noshb is cleared. at the next reset the shadow byte data is loaded into the eemcr. the shadow byte can be protected from being programmed or erased by setting the shprot bit of eeprot register.
eeprom memory advance information 68hc(9)12d60 ? rev 3.0 118 eeprom memory motorola 8.5 eeprom control registers bits[7:4] are loaded at reset from the eeprom shadow byte. note: bits 5 and 4 are reserved for test purposes. these locations in the shadow byte should not be programmed otherwise some locations in the regular eeprom array will no longer be visible. nobdml ? background debug mode lockout disable 0 = the bdm lockout is enabled. 1 = the bdm lockout is disabled. loaded from shadow byte at reset. read anytime. write anytime in special modes (smodn=0). noshb ? shadow byte disable 0 = shadow byte enabled and accessible at address $0fc0. 1 = regular eeprom array at address $0fc0. loaded from shadow byte at reset. read anytime. write anytime in special modes (smodn=0). when noshb cleared, the regular eeprom array byte at address $0fc0 is no longer visible. the shadow byte is accessed instead for both read and program/erase operations. bulk, odd and even program/erase only apply if the shadow byte is enabled. note: bit 6 of the shadow byte should not be cleared (set to ? 0 ? ) in order to have the full eeprom array visible. bit 7654321bit 0 nobdml noshb 1 (1) 1 (1) 1 eeswai protlck eerc reset: ? (2) ? (2) ? (2) ? (2) 1100 eemcr ? eeprom module configuration $00f0 1. bits 4 and 5 have test functions and should not be cleared (set to ? 0 ? ). 2. loaded from shadow byte.
eeprom memory eeprom control registers 68hc(9)12d60 ? rev 3.0 advance information motorola eeprom memory 119 eeswai ? eeprom stops in wait mode 0 = the module is not affected during wait mode 1 = the module ceases to be clocked during wait mode read and write anytime. note: the eeswai bit should be cleared if the wait mode vectors are mapped in the eeprom array. protlck ? block protect write lock 0 = block protect bits and bulk erase protection bit can be written 1 = block protect bits are locked read anytime. write once in normal modes (smodn = 1), set and clear any time in special modes (smodn = 0). eerc ? eeprom charge pump clock 0 = system clock is used as clock source for the internal charge pump. internal rc oscillator is stopped. 1 = internal rc oscillator drives the charge pump. the rc oscillator is required when the system bus clock is lower than f prog . read and write anytime. prevents accidental writes to eeprom. read anytime. write anytime if eepgm = 0 and protlck = 0. shprot ? shadow byte protection 0 = the shadow byte can be programmed and erased. 1 = the shadow byte is protected from being programmed and erased. bit 7654321bit 0 shprot 1 1 bprot4 bprot3 bprot2 bprot1 bprot0 reset: 1 1 1 1 1 1 1 1 eeprot ? eeprom block protect $00f1
eeprom memory advance information 68hc(9)12d60 ? rev 3.0 120 eeprom memory motorola bprot[4:0] ? eeprom block protection 0 = associated eeprom block can be programmed and erased. 1 = associated eeprom block is protected from being programmed and erased. bulkp ? bulk erase protection 0 = eeprom can be bulk erased. 1 = eeprom is protected from being bulk or row erased. read anytime. write anytime if eepgm = 0 and protlck = 0. byte ? byte and aligned word erase 0 = bulk or row erase is enabled. 1 = one byte or one aligned word erase only. read anytime. write anytime if eepgm = 0. row ? row or bulk erase (when byte = 0) 0 = erase entire eeprom array. 1 = erase only one 32-byte row. read anytime. write anytime if eepgm = 0. byte and row have no effect when erase = 0 table 8-1. 1k byte eeprom block protection bit name block protected block size bprot4 $0c00 to $0dff 512 bytes bprot3 $0e00 to $0eff 256 bytes bprot2 $0f00 to $0f7f 128 bytes bprot1 $0f80 to $0fbf 64 bytes bprot0 $0fc0 to $0fff 64 bytes bit 7654321bit 0 bulkp 0 0 byte row erase eelat eepgm reset:10000000 eeprog ? eeprom control $00f3
eeprom memory eeprom control registers 68hc(9)12d60 ? rev 3.0 advance information motorola eeprom memory 121 erase ? erase control 0 = eeprom configuration for programming. 1 = eeprom configuration for erasure. read anytime. write anytime if eepgm = 0. configures the eeprom for erasure or programming. eelat ? eeprom latch control 0 = eeprom set up for normal reads. 1 = eeprom address and data bus latches set up for programming or erasing. read anytime. write anytime if eepgm = 0. byte, row, erase and eelat bits can be written simultaneously or in any sequence. eepgm ? program and erase enable 0 = disables program/erase voltage to eeprom. 1 = applies program/erase voltage to eeprom. the eepgm bit can be set only after eelat has been set. when eelat and eepgm are set simultaneously, eepgm remains clear but eelat is set. the bulkp, byte, row, erase and eelat bits cannot be changed when eepgm is set. to complete a program or erase, two successive writes to clear eepgm and eelat bits are required before reading the programmed data. a write to an eeprom location has no effect when eepgm is set. latched address and data cannot be modified during program or erase. table 8-2. erase selection byte row block size 0 0 bulk erase entire eeprom array 0 1 row erase 32 bytes 1 0 byte or aligned word erase 1 1 byte or aligned word erase
eeprom memory advance information 68hc(9)12d60 ? rev 3.0 122 eeprom memory motorola a program or erase operation should follow the sequence below: 1. write byte, row and erase to the desired value, write eelat = 1 2. write a byte or an aligned word to an eeprom address 3. write eepgm = 1 4. wait for programming (t prog ) or erase (t erase ) delay time 5. write eepgm = 0 6. write eelat = 0 it is possible to program/erase more bytes or words without intermediate eeprom reads, by jumping from step 5 to step 2.
68hc(9)12d60 ? rev 3.0 advance information motorola resets and interrupts 123 advance information ? 68hc(9)12d60 section 9. resets and interrupts 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 9.3 maskable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 9.4 latching of interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 9.5 interrupt control and priority registers . . . . . . . . . . . . . . . . . 127 9.6 resets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 9.7 effects of reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 9.8 register stacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 9.9 customer information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 9.2 introduction cpu12 exceptions include resets and interrupts. each exception has an associated 16-bit vector, which points to the memory location where the routine that handles the exception is located. vectors are stored in the upper 128 bytes of the standard 64k byte address map. the six highest vector addresses are used for resets and non-maskable interrupt sources. the remainder of the vectors are used for maskable interrupts, and all must be initialized to point to the address of the appropriate service routine.
resets and interrupts advance information 68hc(9)12d60 ? rev 3.0 124 resets and interrupts motorola 9.2.1 exception priority a hardware priority hierarchy determines which reset or interrupt is serviced first when simultaneous requests are made. six sources are not maskable. the remaining sources are maskable, and any one of them can be given priority over other maskable interrupts. the priorities of the non-maskable sources are: 1. por or reset pin 2. clock monitor reset 3. cop watchdog reset 4. unimplemented instruction trap 5. software interrupt instruction (swi) 6. xirq signal (if x bit in ccr = 0) 9.3 maskable interrupts maskable interrupt sources include on-chip peripheral systems and external interrupt service requests. interrupts from these sources are recognized when the global interrupt mask bit (i) in the ccr is cleared. the default state of the i bit out of reset is one, but it can be written at any time. interrupt sources are prioritized by default but any one maskable interrupt source may be assigned the highest priority by means of the hprio register. the relative priorities of the other sources remain the same. an interrupt that is assigned highest priority is still subject to global masking by the i bit in the ccr, or by any associated local bits. interrupt vectors are not affected by priority assignment. hprio can only be written while the i bit is set (interrupts inhibited). table 9-1 lists interrupt sources and vectors in default order of priority.
resets and interrupts latching of interrupts 68hc(9)12d60 ? rev 3.0 advance information motorola resets and interrupts 125 9.4 latching of interrupts xirq is always level triggered and irq can be selected as a level triggered interrupt. these level triggered interrupt pins should only be released during the appropriate interrupt service routine. generally the interrupt service routine will handshake with the interrupting logic to release the pin. in this way, the mcu will start the interrupt service sequence only to determine that there is no longer an interrupt source. in the event that this does not occur, the trap vector will be taken. if irq is selected as an edge triggered interrupt, the hold time of the level after the active edge is independent of when the interrupt is serviced. as long as the minimum hold time is met, the interrupt will be latched inside the mcu. in this case the irq edge interrupt latch is cleared automatically when the interrupt is serviced. all of the remaining interrupts are latched by the mcu with a flag bit. these interrupt flags should be cleared during an interrupt service routine or when interrupts are masked by the i bit. by doing this, the mcu will never get an unknown interrupt source and take the trap vector.
resets and interrupts advance information 68hc(9)12d60 ? rev 3.0 126 resets and interrupts motorola table 9-1. interrupt vector map vector address interrupt source ccr mask local enable hprio value to elevate $fffe, $ffff reset none none ? $fffc, $fffd clock monitor fail reset none copctl (cme, fcme) ? $fffa, $fffb cop failure reset none cop rate selected ? $fff8, $fff9 unimplemented instruction trap none none ? $fff6, $fff7 swi none none ? $fff4, $fff5 xirq x bit none ? $fff2, $fff3 irq i bit intcr (irqen) $f2 $fff0, $fff1 real time interrupt i bit rtictl (rtie) $f0 $ffee, $ffef timer channel 0 i bit tmsk1 (c0i) $ee $ffec, $ffed timer channel 1 i bit tmsk1 (c1i) $ec $ffea, $ffeb timer channel 2 i bit tmsk1 (c2i) $ea $ffe8, $ffe9 timer channel 3 i bit tmsk1 (c3i) $e8 $ffe6, $ffe7 timer channel 4 i bit tmsk1 (c4i) $e6 $ffe4, $ffe5 timer channel 5 i bit tmsk1 (c5i) $e4 $ffe2, $ffe3 timer channel 6 i bit tmsk1 (c6i) $e2 $ffe0, $ffe1 timer channel 7 i bit tmsk1 (c7i) $e0 $ffde, $ffdf timer overflow i bit tmsk2 (toi) $de $ffdc, $ffdd pulse accumulator overflow i bit pactl (paovi) $dc $ffda, $ffdb pulse accumulator input edge i bit pactl (pai) $da $ffd8, $ffd9 spi serial transfer complete i bit sp0cr1 (spie) $d8 $ffd6, $ffd7 sci 0 i bit sc0cr2 (tie, tcie, rie, ilie) $d6 $ffd4, $ffd5 sci 1 i bit sc1cr2 (tie, tcie, rie, ilie) $d4 $ffd2, $ffd3 atd0 or atd1 i bit atdxctl2 (ascie) $d2 $ffd0, $ffd1 mscan wake-up i bit crier (wupie) $d0 $ffce, $ffcf key wake-up g or h i bit kwieg[6:0] and kwieh[7:0] $ce $ffcc, $ffcd modulus down counter underflow i bit mcctl (mczi) $cc $ffca, $ffcb pulse accumulator b overflow i bit pbctl (pbovi) $ca $ffc8, $ffc9 mscan errors i bit crier (rwrnie, twrnie, rerrie, terrie, boffie, ovrie) $c8 $ffc6, $ffc7 mscan receive i bit crier (rxfie) $c6 $ffc4, $ffc5 mscan transmit i bit ctcr (txeie[2:0]) $c4 $ffc2, $ffc3 cgm lock and limp home i bit pllcr (lockie, lhie) $c2 $ff80 ? $ffc1 reserved i bit $80 ? $c0
resets and interrupts interrupt control and priority registers 68hc(9)12d60 ? rev 3.0 advance information motorola resets and interrupts 127 9.5 interrupt control and priority registers irqe ? irq select edge sensitive only 0 = irq configured for low-level recognition. 1 = irq configured to respond only to falling edges (on pin pe1/irq ). irqe can be read anytime and written once in normal modes. in special modes, irqe can be read anytime and written anytime, except the first write is ignored. irqen ? external irq enable the irq pin has an active pull-up. see table 3-4 . 0 = external irq pin is disconnected from interrupt logic. 1 = external irq pin is connected to interrupt logic. irqen can be read and written anytime in all modes. dly ? enable oscillator start-up delay on exit from stop the delay time of about 4096 cycles is based on the x clock rate chosen. 0 = no stabilization delay imposed on exit from stop mode. a stable external oscillator must be supplied. 1 = stabilization delay is imposed before processing resumes after stop. dly can be read anytime and written once in normal modes. in special modes, dly can be read and written anytime. bit 7654321bit 0 irqeirqendly00000 reset: 0 1 100000 intcr ? interrupt control register $001e
resets and interrupts advance information 68hc(9)12d60 ? rev 3.0 128 resets and interrupts motorola write only if i mask in ccr = 1 (interrupts inhibited). read anytime. to give a maskable interrupt source highest priority, write the low byte of the vector address to the hprio register. for example, writing $f0 to hprio would assign highest maskable interrupt priority to the real-time interrupt timer ($fff0). if an un-implemented vector address or a non-i- masked vector address (value higher than $f2) is written, then irq will be the default highest priority interrupt. 9.6 resets there are four possible sources of reset. power-on reset (por), and external reset on the reset pin share the normal reset vector. the computer operating properly (cop) reset and the clock monitor reset each has a vector. entry into reset is asynchronous and does not require a clock but the mcu cannot sequence out of reset without a system clock. 9.6.1 power-on reset a positive transition on v dd causes a power-on reset (por). an external voltage level detector, or other external reset circuits, are the usual source of reset in a system. the por circuit only initializes internal circuitry during cold starts and cannot be used to force a reset as system voltage drops. it is important to use an external low voltage reset circuit (for example: mc34064 or mc33464) to prevent power transitions or corruption of ram or eeprom. bit 7654321bit 0 1 1 psel5 psel4 psel3 psel2 psel1 0 reset:11110010 hprio ? highest priority i interrupt $001f
resets and interrupts resets 68hc(9)12d60 ? rev 3.0 advance information motorola resets and interrupts 129 9.6.2 external reset the cpu distinguishes between internal and external reset conditions by sensing whether the reset pin rises to a logic one in less than eight e- clock cycles after an internal device releases reset. when a reset condition is sensed, the reset pin is driven low by an internal device for about 16 e-clock cycles, then released. eight e-clock cycles later it is sampled. if the pin is still held low, the cpu assumes that an external reset has occurred. if the pin is high, it indicates that the reset was initiated internally by either the cop system or the clock monitor. to prevent a cop or clock monitor reset from being detected during an external reset, hold the reset pin low for at least 32 cycles. an external rc power-up delay circuit on the reset pin is not recommended as circuit charge time can cause the mcu to misinterpret the type of reset that has occurred. 9.6.3 cop reset the mcu includes a computer operating properly (cop) system to help protect against software failures. when cop is enabled, software must write $55 and $aa (in this order) to the coprst register in order to keep a watchdog timer from timing out. other instructions may be executed between these writes. a write of any value other than $55 or $aa or software failing to execute the sequence properly causes a cop reset to occur. in addition, windowed cop operation can be selected. in this mode, a write to the coprst register must occur in the last 25% of the selected period. a premature write will also reset the part. 9.6.4 clock monitor reset if clock frequency falls below a predetermined limit when the clock monitor is enabled, a reset occurs.
resets and interrupts advance information 68hc(9)12d60 ? rev 3.0 130 resets and interrupts motorola 9.7 effects of reset when a reset occurs, mcu registers and control bits are changed to known start-up states, as follows. 9.7.1 operating mode and memory map operating mode and default memory mapping are determined by the states of the bkgd, moda, and modb pins during reset. the smodn, moda, and modb bits in the mode register reflect the status of the mode-select inputs at the rising edge of reset. operating mode and default maps can subsequently be changed according to strictly defined rules. 9.7.2 clock and watchdog control logic the cop watchdog system is enabled, with the cr[2:0] bits set for the longest duration time-out. the clock monitor is disabled. the rtif flag is cleared and automatic hardware interrupts are masked. the rate control bits are cleared, and must be initialized before the rti system is used. the dly control bit is set to specify an oscillator start-up delay upon recovery from stop mode. 9.7.3 interrupts psel is initialized in the hprio register with the value $f2, causing the external irq pin to have the highest i-bit interrupt priority. the irq pin is configured for level-sensitive operation (for wired-or systems). however, the interrupt mask bits in the cpu12 ccr are set to mask x- and i-related interrupt requests. 9.7.4 parallel i/o if the mcu comes out of reset in a single-chip mode, all ports are configured as general-purpose high-impedance inputs.
resets and interrupts register stacking 68hc(9)12d60 ? rev 3.0 advance information motorola resets and interrupts 131 if the mcu comes out of reset in an expanded mode, port a and port b are used for the address/data bus, and port e pins are normally used to control the external bus (operation of port e pins can be affected by the pear register). out of reset, port g, port h, port p, port s, port t, port can[7:2], port ad0 and port ad1 are all configured as general-purpose inputs. 9.7.5 central processing unit after reset, the cpu fetches a vector from the appropriate address, then begins executing instructions. the stack pointer and other cpu registers are indeterminate immediately after reset. the ccr x and i interrupt mask bits are set to mask any interrupt requests. the s bit is also set to inhibit the stop instruction. 9.7.6 memory after reset, the internal register block is located from $0000 to $01ff, ram is at $0000 to $07ff, and eeprom is at $0c00 to $0fff. in single chip mode the two flash eeprom(68hc912d60)/rom(68hc12d60) modules are located from $1000 to $7fff and $8000 to $ffff. 9.7.7 other resources the enhanced capture timer (ect), pulse width modulation timer (pwm), serial communications interfaces (sci0 and sci1), serial peripheral interface (spi), motorola scalable can (mscan) and analog-to-digital converters (atd0 and atd1) are off after reset. 9.8 register stacking once enabled, an interrupt request can be recognized at any time after the i bit in the ccr is cleared. when an interrupt service request is recognized, the cpu responds at the completion of the instruction being executed. interrupt latency varies according to the number of cycles
resets and interrupts advance information 68hc(9)12d60 ? rev 3.0 132 resets and interrupts motorola required to complete the instruction. some of the longer instructions can be interrupted and will resume normally after servicing the interrupt. when the cpu begins to service an interrupt, the instruction queue is cleared, the return address is calculated, and then it and the contents of the cpu registers are stacked as shown in table 9-2 . after the ccr is stacked, the i bit (and the x bit, if an xirq interrupt service request is pending) is set to prevent other interrupts from disrupting the interrupt service routine. the interrupt vector for the highest priority source that was pending at the beginning of the interrupt sequence is fetched, and execution continues at the referenced location. at the end of the interrupt service routine, an rti instruction restores the content of all registers from information on the stack, and normal program execution resumes. if another interrupt is pending at the end of an interrupt service routine, the register unstacking and restacking is bypassed and the vector of the interrupt is fetched. 9.9 customer information before disabling an interrupt using a local interrupt control bit, set the i mask bit in the ccr. failing to do so may cause an swi interrupt to be fetched instead of the vector for the interrupt source that was disabled. table 9-2. stacking order on entry to interrupts memory location cpu registers sp ? 2 rtn h : rtn l sp ? 4 y h : y l sp ? 6 x h : x l sp ? 8 b : a sp ? 9 ccr
68hc(9)12d60 ? rev 3.0 advance information motorola rom 133 advance information ? 68hc(9)12d60 section 10. rom 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.3 rom array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.2 introduction the 68hc12d60 contains 60 kbytes of read-only memory (rom). the rom array is arranged in a 16-bit configuration and may be read as either bytes, aligned words or misaligned words. access time is one bus cycle for byte and aligned word access and two bus cycles for misaligned word operations. 10.3 rom array the rom is made of a 28k byte array mapped from $1000 to $7fff and of a 32 k byte array mapped from $8000 to $ffff at reset. the maprom bit in the misc register allows the swapping of the two arrays. romon28 and romon32 enable or disable the rom module.
rom advance information 68hc(9)12d60 ? rev 3.0 134 rom motorola
68hc(9)12d60 ? rev 3.0 advance information motorola i/o ports with key wake-up 135 advance information ? 68hc(9)12d60 section 11. i/o ports with key wake-up 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 11.3 key wake-up and port registers . . . . . . . . . . . . . . . . . . . . . .136 11.4 key wake-up input filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 11.2 introduction the 112qfp 68hc(9)12d60 offers 16 additional i/o port pins with key wake-up capability on 15 of them (kwg7 is used for i 2 c start detect). only two (kwg4 and kwh4) are available on the 80qfp package. all port g and port h pins should either be defined as outputs or have their pull-ups/downs enabled. the key wake-up feature of the 68hc(9)12d60 issues an interrupt that will wake up the cpu when it is in the stop or wait mode. two ports are associated with the key wake-up function: port g and port h. port g and port h wake-ups are triggered with a falling signal edge. for each pin which has an interrupt enabled, there is a path to the interrupt request signal which has no clocked devices when the part is in stop mode. this allows an active edge to bring the part out of stop. digital filtering is included to prevent pulses shorter than a specified value from waking the part from stop. an interrupt is generated when a bit in the kwifg or kwifh register and its corresponding kwieg or kwieh bit are both set. all 15 bits/pins share the same interrupt vector. key wake-ups can be used with the pins configured as inputs or outputs.
i/o ports with key wake-up advance information 68hc(9)12d60 ? rev 3.0 136 i/o ports with key wake-up motorola pull-up/down status is selected by pgupd and phupd input pins: pull- up when pxupd pin is high, pull-down when pxupd pin is low. on 80qfp these pins are tied internally so that kwg4 is pull-up and kwh4 is pull-down. default register addresses, as established after reset, are indicated in the following descriptions. for information on re-mapping the register block, refer to operating modes and resource mapping . 11.3 key wake-up and port registers read and write anytime. read and write anytime. bit 7654321bit 0 pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 reset: ???????? alt. pin function ? kwg6 kwg5 kwg4 kwg3 kwg2 kwg1 kwg0 portg ? port g register $0028 bit 7654321bit 0 ph7 ph6 ph5 ph4 ph3 ph2 ph1 ph0 reset: ???????? alt. pin function kwh7 kwh6 kwh5 kwh4 kwh3 kwh2 kwh1 kwh0 porth ? port h register $0029
i/o ports with key wake-up key wake-up and port registers 68hc(9)12d60 ? rev 3.0 advance information motorola i/o ports with key wake-up 137 data direction register g is associated with port g and designates each pin as an input or output. read and write anytime 0 = associated pin is an input 1 = associated pin is an output data direction register h is associated with port h and designates each pin as an input or output. read and write anytime. 0 = associated pin is an input 1 = associated pin is an output bit 7654321bit 0 ddg7 ddg6 ddg5 ddg4 ddg3 ddg2 ddg1 ddg0 reset: 0 0 000000 ddrg ? port g data direction register $002a bit 7654321bit 0 ddh7 ddh6 ddh5 ddh4 ddh3 ddh2 ddh1 ddh0 reset: 0 0 000000 ddrh ? port h data direction register $002b
i/o ports with key wake-up advance information 68hc(9)12d60 ? rev 3.0 138 i/o ports with key wake-up motorola read and write anytime. wi2ce ? wake-up i 2 c enable 0 = pg6 default key wake-up on falling edge 1 = i 2 c start condition detection on pg7 and pg6 when wi2ce is set, pg6 and pg7 operate in wired-or or open-drain mode. the i 2 c start condition is defined as a high to low transition of the sda line when scl is high. when wi2ce is set, a falling edge on pg6 (sda) is recognized only if pg7 (scl) is high. depending on wi2ce bit, kwieg6 enables either falling edge or i 2 c start condition interrupt. kwieg[6:0] ? key wake-up port g interrupt enables 0 = interrupt for the associated bit is disabled 1 = interrupt for the associated bit is enabled read and write anytime. kwieh[7:0] ? key wake-up port h interrupt enables 0 = interrupt for the associated bit is disabled 1 = interrupt for the associated bit is enabled bit 7654321bit 0 wi2ce kwieg6 kwieg5 kwieg4 kwieg3 kwieg2 kwieg1 kwieg0 reset: 0 0 000000 kwieg ? key wake-up port g interrupt enable register $002c bit 7654321bit 0 kwieh7 kwieh6 kwieh5 kwieh4 kwieh3 kwieh2 kwieh1 kwieh0 reset: 0 0 000000 kwieh ? key wake-up port h interrupt enable register $002d
i/o ports with key wake-up key wake-up and port registers 68hc(9)12d60 ? rev 3.0 advance information motorola i/o ports with key wake-up 139 each flag, except bit 6, is set by a falling edge on its associated input pin. to clear the flag, write one to the corresponding bit in kwifg. read and write anytime bit 7 always reads zero. kwifg6 ? key wake-up port g flag 6 0 = falling edge on the associated bit or i2c start condition has not occurred 1 = falling edge on the associated bit or i2c start condition has occurred (an interrupt will occur if the associated enable bit is set) depending on wi2ce bit in kwieg register, kwifg6 flags either falling edge or i2c start condition. kwifg[5:0] ? key wake-up port g flags 0 = falling edge on the associated bit has not occurred 1 = falling edge on the associated bit has occurred (an interrupt will occur if the associated enable bit is set). bit 7654321bit 0 0 kwifg6 kwifg5 kwifg4 kwifg3 kwifg2 kwifg1 kwifg0 reset: 0 0 000000 kwifg ? key wake-up port g flag register $002e
i/o ports with key wake-up advance information 68hc(9)12d60 ? rev 3.0 140 i/o ports with key wake-up motorola read and write anytime. each flag is set by a falling edge on its associated input pin. to clear the flag, write one to the corresponding bit in kwifh. kwifh[7:0] ? key wake-up port h flags 0 = falling edge on the associated bit has not occurred 1 = falling edge on the associated bit has occurred (an interrupt will occur if the associated enable bit is set) 11.4 key wake-up input filter the kwu input signals are filtered by a digital filter which is active only during stop mode. the purpose of the filter is to prevent single pulses shorter than a specified value from waking the part from stop. the filter is composed of an internal oscillator and a majority voting logic. the filter oscillator starts the oscillation by detecting a triggering edge on an input if the corresponding interrupt enable bit is set. the majority voting logic takes three samples of an asserted input pin at each filter oscillator period and if two samples are taken at the triggering level, the filter recognizes a valid triggering level and sets the corresponding interrupt flag. in this way the majority voting logic rejects the short non- triggering state between two incoming triggering pulses. as the filter is shared with all kwu inputs, the filter considers any pulse coming from any input pin for which the corresponding interrupt enable bit is set. the timing specification is given for a single pulse. the time interval between the triggering edges of two following pulses should be greater than the t kwsp in order to be considered as a single pulse by the filter. if bit 7654321bit 0 kwifh7 kwifh6 kwifh5 kwifh4 kwifh3 kwifh2 kwifh1 kwifh0 reset: 0 0 0 0 0 0 0 0 kwifh ? key wake-up port h flag register $002f
i/o ports with key wake-up key wake-up input filter 68hc(9)12d60 ? rev 3.0 advance information motorola i/o ports with key wake-up 141 this time interval is shorter than t kwsp , the majority voting logic may treat the two consecutive pulses as a single valid pulse. the filter is shared by all the kwu pins. hence any valid triggering level on any kwu pin is seen by the filter. the timing specification applies to the input of the filter. figure 11-1. stop key wake-up filter (falling edge trigger) timing glitch, filtered out, no stop wake-up valid stop wake-up pulse t kwstp min. t kwsp minimum time interval between pulses to be recognized as single pulses t kwstp max.
i/o ports with key wake-up advance information 68hc(9)12d60 ? rev 3.0 142 i/o ports with key wake-up motorola
68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 143 advance information ? 68hc(9)12d60 section 12. clock functions 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 12.3 clock sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 12.4 phase-locked loop (pll) . . . . . . . . . . . . . . . . . . . . . . . . . . .145 12.5 acquisition and tracking modes. . . . . . . . . . . . . . . . . . . . . . .147 12.6 limp-home and fast stop recovery modes . . . . . . . . . . . . 149 12.7 system clock frequency formulas . . . . . . . . . . . . . . . . . . . . . 167 12.8 clock divider chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 12.9 computer operating properly (cop) . . . . . . . . . . . . . . . . . . .172 12.10 real-time interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 12.11 clock monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 12.12 clock function registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 12.2 introduction clock generation circuitry generates the internal and external e-clock signals as well as internal clock signals used by the cpu and on-chip peripherals. a clock monitor circuit, a computer operating properly (cop) watchdog circuit, and a periodic interrupt circuit are also incorporated into the 68hc(9)12d60.
clock functions advance information 68hc(9)12d60 ? rev 3.0 144 clock functions motorola 12.3 clock sources a compatible external clock signal can be applied to the extal pin or the mcu can generate a clock signal using an on-chip oscillator circuit and an external crystal or ceramic resonator. the mcu uses several types of internal clock signals derived from the primary clock signal: txclk clocks are used by the cpu. eclk and pclk are used by the bus interfaces, spi, pwm, atd0 and atd1. mclk is either pclk or xclk, and drives on-chip modules such as sci0, sci1 and ect. xclk drives on-chip modules such as rti, cop and restart-from-stop delay time. slwclk is used as a calibration output signal. the mscan module is clocked by extali or sysclk, under control of an mscan bit. the clock monitor is clocked by extali. the bdm system is clocked by bclk or eclk, under control of a bdm bit. a slow mode clock divider is included to deliver a lower clock frequency for the sci baud rate generators, the ect timer module, and the rti and cop clocks. the slow clock bus frequencies divide the crystal frequency in a programmable range of 4 to 252, with steps of 4. figure 12-1 shows some of the timing relationships. see the clock divider chains section for further details.
clock functions phase-locked loop (pll) 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 145 figure 12-1. internal clock relationships 12.4 phase-locked loop (pll) the phase-locked loop (pll) of the 68hc(9)12d60 is designed for robust operation in an automotive environment. the allowed pll crystal or ceramic resonator reference of 0.5 to 8mhz is selected for the wide availability of components with good stability over the automotive temperature range. please refer to figure 12-6 in section clock divider chains for an overview of system clocks. note: when selecting a crystal, it is recommended to use one with the lowest possible frequency in order to minimise emc emissions. an oscillator design with reduced power consumption allows for slow wait operation with a typical power supply current less than a milli- ampere. the pll circuitry can be bypassed when the vddpll supply is at vss level. in this case, the pll module is powered down and the oscillator output transistor has a stronger transconductance for improved drive of higher frequency resonators (as the crystal frequency needs to be twice the maximum bus frequency). refer to figure 3-5 in pinout and signal descriptions . t1clk t2clk t3clk t4clk int eclk pclk xclk canclk
clock functions advance information 68hc(9)12d60 ? rev 3.0 146 clock functions motorola figure 12-2. pll functional diagram the pll may be used to run the mcu from a different time base than the incoming crystal value. it creates an integer multiple of a reference frequency. for increased flexibility, the crystal clock can be divided by values in a range of 1 ? 8 (in unit steps) to generate the reference frequency. the pll can multiply this reference clock in a range of 1 to 64. although it is possible to set the divider to command a very high clock frequency, do not exceed the specified bus frequency limit for the mcu. if the pll is selected, it will continue to run when in wait mode resulting in more power consumption than normal. to take full advantage of the reduced power consumption of wait mode, turn off the pll before going into wait. please note that in this case the pll stabilization time applies. the pll operation is suspended in stop mode. after stop exit followed by the stabilization time, it resumes operation at the same frequency, provided the auto bit is set. a passive external loop filter must be placed on the control line (xfc pad). the filter is a second-order, low-pass filter to eliminate the vco input ripple. values of components in the diagram are dependent upon the desired vco operation. see xfc description. reduced consumption oscillator extal xtal extali pllclk reference programmable divider pdet phase detector refdv <2:0> loop programmable divider syn <5:0> cpump vco lock loop filter xfc pad up down lock detector refclk divclk slow mode programmable clock divider sldv <5:0> xclk extali 2 slwclk vddpll 2
clock functions acquisition and tracking modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 147 12.5 acquisition and tracking modes the lock detector compares the frequencies of the vco feedback clock, divclk, and the final reference clock, refclk. therefore, the speed of the lock detector is directly proportional to the final reference frequency. the circuit determines the mode of the pll and the lock condition based on this comparison. the pll filter is manually or automatically configurable into one of two operating modes:  acquisition mode ? in acquisition mode, the filter can make large frequency corrections to the vco. this mode is used at pll start- up or when the pll has suffered a severe noise hit and the vco frequency is far off the desired frequency. this mode can also be desired in harsh environments when the leakage levels on the filter pin (xfc) can overcome the tracking currents of the pll charge pump. when in acquisition mode, the acq bit in the pll control register is clear.  tracking mode ? in tracking mode, the filter makes only small corrections to the frequency of the vco. the pll enters tracking mode when the vco frequency is nearly correct. the pll is automatically in tracking mode when not in acquisition mode or when the acq bit is set. the pll can change the bandwidth or operational mode of the loop filter manually or automatically. with an identical filtering time constant, the pll bandwidth is larger in acquisition mode than in tracking by a ratio of about 3. in automatic bandwidth control mode (auto = 1), the lock detector automatically switches between acquisition and tracking modes. automatic bandwidth control mode also is used to determine when the vco clock, pllclk, is safe to use as the source for the base clock, sysclk. if pll lock interrupt requests are enabled, the software can wait for an interrupt request and then check the lock bit. if cpu interrupts are disabled, software can poll the lock bit continuously (during pll start-up, usually) or at periodic intervals. in either case, when the lock bit is set, the pllclk clock is safe to use as the source
clock functions advance information 68hc(9)12d60 ? rev 3.0 148 clock functions motorola for the base clock. see clock divider chains . if the vco is selected as the source for the base clock and the lock bit is clear, the pll has suffered a severe noise hit and the software must take appropriate action, depending on the application. the following conditions apply when the pll is in automatic bandwidth control mode:  the acq bit is a read-only indicator of the mode of the filter.  the acq bit is set when the vco frequency is within a certain tolerance, ? trk , and is cleared when the vco frequency is out of a certain tolerance, ? unt . see 19 electrical characteristics.  the lock bit is a read-only indicator of the locked state of the pll.  the lock bit is set when the vco frequency is within a certain tolerance, ? lock , and is cleared when the vco frequency is out of a certain tolerance, ? unl . see 19 electrical characteristics.  cpu interrupts can occur if enabled (lockie = 1) when the lock condition changes, toggling the lock bit. the pll also can operate in manual mode (auto = 0). all lock features described above are active in this mode, only the bandwidth control is disabled. manual mode is used mainly for systems operating under harsh conditions (e.g.uncoated pcbs in automotive environments). when this is the case, the pll is likely to remain in acquisition mode. the following conditions apply when in manual mode:  acq is a writable control bit that controls the mode of the filter. before turning on the pll in manual mode, the acq bit must be clear.  in case tracking is desired (acq = 1), the software must wait a given time, tacq, after turning on the pll by setting pllon in the pll control register. this is to avoid switching to tracking mode too early while the xfc voltage level is still too far away from its quiescent value corresponding to the target frequency. this operation would be very detrimental to the stabilization time.
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 149 12.6 limp-home and fast stop recovery modes if the crystal frequency is not available due to a crystal failure or a long crystal start-up time, the mcu system clock can be supplied by the vco at its minimum operating frequency, f vcomin . this mode of operation is called limp-home mode and is only available when the vddpll supply voltage is at vdd level (i.e. power supply for the pll module is present). upon power-up, the ability of the system to start in limp-home mode is restricted to normal mcu modes only. the clock monitor circuit (see section clock monitor) can detect the loss of extali, the external clock input signal, regardless of whether this signal is used as the source for mcu clocks or as the pll reference clock. the clock monitor control bits, cme and fcme, are used to enable or disable external clock detection. a missing external clock may occur in the three following instances:  during normal clock operation.  at power-on reset.  in the stop exit sequence 12.6.1 clock loss during normal operation the ? no limp-home mode ? bit, nolhm, determines how the mcu responds to an external clock loss in this case. with limp home mode disabled (nolhm bit set) and the clock monitor enabled (cme or fcme bits set), on a loss of clock the mcu is reset via the clock monitor reset vector. a latch in the pll control section prevents the chip exiting reset in limp home mode (this is required as the nolhm bit gets cleared by reset). only external clock activity can bring the mcu out from this reset state. once reset has been exited, the latch is cleared and another session, with or without limp home mode enabled, can take place. this is the same behavior as standard m68hc12 circuits without pll or operation with vddpll at vss level. with limp home mode enabled (nolhm bit cleared) and the clock monitor enabled (cme or fcme bits set), on a loss of clock, the pll
clock functions advance information 68hc(9)12d60 ? rev 3.0 150 clock functions motorola vco clock at its minimum frequency, f vcomin , is provided as the system clock, allowing the mcu to continue operating. the mcu is said to be operating in ? limp-home ? mode with the forced vco clock as the system clock. pllon and bcsp ( ? bus clock select pll ? ) signals are forced high and the mcs ( ? module clock select ? ) signal is forced low. the lhome flag in the pllflg register is set to indicate that the mcu is running in limp-home mode. a change of this flag sets the limp-home interrupt flag, lhif, and if enabled by the lhie bit, the limp-home mode interrupt is requested. the clock monitor is enabled irrespective of cme and fcme bit settings. module clocks to the rti & cop (xclk), bdm (bclk) and ect & sci (mclk) are forced to be pclk (at f vcomin ) and eclk is also equal to f vcomin . mscan clock select is unaffected. figure 12-3. clock loss during normal operation the clock monitor is polled each time the 13-stage free running counter reaches a count of 4096 xclk cycles i.e. mid-count, hence the clock status gets checked once every 8192 xclk cycles. when the presence of an external clock is detected, the mcu exits limp-home mode, clearing the lhome flag and setting the limp-home interrupt flag. upon leaving limp-home mode, bcsp and mcs signals are restored to their 0 --> 4096 limp-home (clocked by xclk) bcsp restore bcsp sysclk pllclk (limp-home) restore pllclk or extali extali 13-stage counter clock monitor fail 0 --> 4096 ab
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 151 values before the clock loss. all clocks return to their normal settings and clock monitor control is returned to the cme & fcme bits. if auto and bcsp bits were set before the clock loss (selecting the pll to provide a system clock) the sysclk ramps-up and the pll locks at the previously selected frequency. to prevent pll operation when the external clock frequency comes back, software should clear the bcsp bit while running in limp-home mode. the two shaded regions a and b in figure 12-3 present a of code run away due to incorrect clocks on sysclk if the mcu is clocked by extali and the pll is not used. in region a , there is a delay between the loss of clock and its detection by the clock monitor. when the extali clock signal is disturbed, the clock generation circuitry may receive an out of spec signal and drive the cpu with irregular clocks. this may lead to code runaway. in region b , as the 13-stage counter is free running, the count of 4096 may be reached when the amplitude of the extali clock has not stabilized. in this case, an improper extali is sent to the clock generation circuitry when limp-home mode is exited. this may also cause code runaway. if the mcu is clocked by the pll, the risk of code runaway is very low, but it can still occur under certain conditions due to irregular clocks from the clock source appearing on the sysclk. caution: the cop watch dog should always be enabled in order to reset the mcu in case of a code runaway situation. note: it is always advisable to take additional precautions within the application software to trap such situations. 12.6.2 no clock at power-on reset the voltage level on vddpll determines how the mcu responds to an external clock loss in this case. with the vddpll supply voltage at vdd level, any reset sets the clock monitor enable bit (cme) and the pllon bit and clears the nolhm bit.
clock functions advance information 68hc(9)12d60 ? rev 3.0 152 clock functions motorola therefore, if the mcu is powered up without an external clock, limp- home mode is entered provided the mcu is in a normal mode of operation. figure 12-4. no clock at power-on reset vdd power-on detector clock monitor fail extali 13-stage counter internal reset 0 --> 4096 limp-home (clocked by xclk) bcsp reset: bcsp = 0 sysclk pllclk (l.h.) extali sysclk pllclk (software check of limp-home flag) extali (slow extali) 0 --> 4096 (slow extali)
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 153 during this power up sequence, after the por pulse falling edge, the vco supplies the limp-home clock frequency to the 13-stage counter, as the bcsp output is forced high and mcs is forced low. xclk, bclk and mclk are forced to be pclk, which is supplied by the vco at f vcomin . the initial period taken for the 13-stage counter to reach 4096 defines the internal reset period. if the clock monitor indicates the presence of an external clock during the internal reset period, limp-home mode is de-asserted and the 13-stage counter is then driven by extali clock. after the 13-stage counter reaches a count of 4096 xclk cycles, the internal reset is released, the 13-stage counter is reset and the mcu exits reset normally using extali clock. however, if the crystal start-up time is longer than the initial count of 4096 xclk cycles, or in the absence of an external clock, the mcu will leave the reset state in limp-home mode. the lhome flag is set and lhif limp-home interrupt request is set, to indicate it is not operating at the desired frequency. then after yet another 4096 xclk cycles followed regularly by 8192 xclk cycles (corresponding to the 13-stage counter timing out), a check of the clock monitor status is performed. when the presence of an external clock is detected limp-home mode is exited generating a limp-home interrupt if enabled. caution: the clock monitor circuit can be misled by the extali clock into reporting a good signal before it has fully stabilised. under these conditions improper extali clock cycles can occur on sysclk. this may lead to a code runaway. to ensure that this situation does not occur, the external reset period should be longer than the oscillator stabilisation time - this is an application dependent parameter. with the vddpll supply voltage at vss level, the pll module and hence limp-home mode are disabled, the device will remain effectively in a static state whilst there is no activity on extali. the internal reset period and mcu operation will execute only on extali clock. note: the external clock signal must stabilise within the initial 4096 reset counter cycles.
clock functions advance information 68hc(9)12d60 ? rev 3.0 154 clock functions motorola 12.6.3 stop exit and fast stop recovery stop mode is entered when a stop instruction is executed. recovery from stop depends primarily on the state of the three status bits nolhm, cme & dly. the dly bit controls the duration of the waiting period between the actual exit for some key blocks (e.g. clock monitor, clock generators) and the effective exit from stop for all the rest of the mcu. dly=1 enables the 13-stage counter to generate a 4096 count delay. dly=0 selects no delay. as the xclk is derived from the slow mode divider, the value in the slow register modifies the actual delay time. note: dly=0 is only recommended when there is a good signal available at the extal pin (e.g. an external square wave source). stop mode is exited with an external reset, an external interrupt from irq or xirq, a key wake-up interrupt from port j or port h, or an mscan wake-up interrupt.
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 155 figure 12-5. stop exit and fast stop recovery 12.6.4 stop exit without limp home mode, clock monitor disabled (nolhm=1, cme=0, dly=x) if limp home mode is disabled (v ddpll =v ss or nolhm bit set) and the cme (or fcme) bit is cleared, the mcu goes into stop mode when a stop instruction is executed. if extali clock is present then exit from stop will occur normally using this clock. under this condition, dly should always be set to allow the crystal to stabilise and minimise the risk of code runaway. with dly=1 execution resumes after a delay of 4096 xclk cycles. note: the external clock signal should stabilise within the 4096 reset counter cycles. use of dly=0 is not recommended due to this requirement. clock monitor fail extali 13-stage counter 0 --> 4096 limp-home (clocked by xclk) bcsp restore bcsp sysclk pllclk (l.h.) restore pllclk or extali stop (dly = 1) stop (dly = 0)
clock functions advance information 68hc(9)12d60 ? rev 3.0 156 clock functions motorola 12.6.5 executing the stop instruction without limp home mode, clock monitor enabled (nolhm=1, cme=1, dly=x) if the nolhm bit and the cme (or fcme) bits are set, a clock monitor failure is detected when a stop instruction is executed and the mcu resets via the clock monitor reset vector. 12.6.6 stop exit in limp home mode with delay (nolhm=0, cme=x, dly=1) if the nolhm bit is cleared, then the cme (or fcme) bit is masked when a stop instruction is executed to prevent a clock monitor failure. when coming out of stop mode, the mcu goes into limp-home mode where cme and fcme signals are asserted. when using a crystal oscillator, a normal stop exit sequence requires the dly bit to be set to allow for the crystal stabilization period. with the 13-stage counter clocked by the vco (at f vcomin ), following a delay of 4096 xclk cycles at the limp-home frequency, if the clock monitor indicates the presence of an external clock, the limp-home mode is de-asserted and the mcu exits stop normally using extali clock. where the crystal start-up time is longer than the initial count of 4096 xclk cycles, or in the absence of an external clock, the mcu recovers from stop following the 4096 count in limp-home mode with both the lhome flag set and the lhif limp-home interrupt request set to indicate it is not operating at the desired frequency. each time the 13-stage counter reaches a count of 4096 xclk cycles, a check of the clock monitor status is performed. when the presence of an external clock is detected, limp-home mode is exited and the lhome flag is cleared. this sets the limp-home interrupt flag and if enabled by the lhie bit, the limp-home mode interrupt is requested. caution: the clock monitor circuit can be misled by extali clock into reporting a good signal before it has fully stabilised. under these conditions, improper extali clock cycles can occur on sysclk. this may lead to a code runaway.
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 157 12.6.7 stop exit in limp home mode without delay (fast stop recovery) (nolhm=0, cme=x, dly=0) fast stop recovery refers to any exit from stop using dly=0. if the nolhm bit is cleared, then the cme (or fcme) bit is masked when a stop instruction is executed to prevent a clock monitor failure. when coming out of stop mode, the mcu goes into limp-home mode where cme and fcme signals are asserted. when using a crystal oscillator, it is possible to exit stop with the dly bit cleared. in this case, stop is de-asserted without delay and the mcu will execute software in limp-home mode, giving the crystal oscillator time to stablise. caution: this mode is not recommended since the risk of the clock monitor detecting incorrect clocks is high. each time the 13-stage counter reaches a count of 4096 xclk cycles (every 8192 cycles), a check of the clock monitor status is performed. if the clock monitor indicates the presence of an external clock limp-home mode is de-asserted, the lhome flag is cleared and the limp-home interrupt flag is set. upon leaving limp-home mode, bcsp and mcs are restored to their values before the loss of clock, and all clocks return to their previous frequencies. if auto and bcsp were set before the clock loss, the sysclk ramps-up and the pll locks at the previously selected frequency. to prevent pll operation when the external clock frequency comes back, the software should clear the bcsp bit while running in limp-home mode. when using an external clock, i.e. a square wave source, it is possible to exit stop with the dly bit cleared. in this case the lhome flag is never set and stop is de-asserted without delay.
clock functions advance information 68hc(9)12d60 ? rev 3.0 158 clock functions motorola 12.6.8 pseudo-stop pseudo-stop is a low power mode similar to stop where the external oscillator is allowed to run (at reduced amplitude) whilst the rest of the part is in stop. this increases the current consumption over stop mode by the amount of current in the oscillator, but reduces wear and mechanical stress on the crystal. if the pstp bit in the pllcr register is set, the mcu goes into pseudo- stop mode when a stop instruction is executed. pseudo-stop mode is exited the same as stop with an external reset, an external interrupt from irq or xirq, a key wake-up interrupt from port j or port h, or an mscan wake-up interrupt. the effect of the dly bit is the same as noted above in stop exit and fast stop recovery . 12.6.9 pseudo-stop exit in limp home mode with delay (nolhm=0, cme=x, dly=1) when coming out of pseudo-stop mode with the nolhm bit cleared and the dly bit set, the mcu goes into limp-home mode (regardless of the state of the cme or fcme bits). the vco supplies the limp-home clock frequency to the 13-stage counter (xclk). the bcsp output is forced high and mcs is forced low. after the 13-stage counter reaches a count of 4096 xclk cycles, a check of the clock monitor is performed and as the crystal oscillator was kept running due to the pseudo-stop mode, the mcu exits stop normally, using the extali clock. in the case where a crystal failure occurred during pseudo-stop, then the mcu exits stop using the limp home clock (f vcomin ) with both the lhome flag set and the lhif limp- home interrupt request set to indicate it is not operating at the desired frequency. each time the 13-stage counter reaches a count of 4096 xclk cycles, a check of the clock monitor is performed. if the clock monitor indicates the presence of an external clock, limp-home mode is de-asserted, the lhome flag is cleared and the lhif limp-home
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 159 interrupt request is set to indicate a return to normal operation using extali clock. 12.6.10 pseudo-stop exit in limp home mode without delay (fast stop recovery) (nolhm=0, cme=x, dly=0) if pseudo-stop is exited with the nolhm bit set to 0 and the dly bit is cleared then the exit from pseudo-stop is accomplished without delay as in fast stop recovery. caution: where pseudo-stop recovers using the limp home clock the vco - which has been held in stop - must be restarted in order to supply the limp home frequency. this restart, which occurs at a high frequency and ramps toward the limp home frequency, is almost immediately supplied to the cpu before it may have reached the steady state frequency. it is possible that the initial clock frequency may be high enough to cause the cpu to function incorrectly with a resultant risk of code runaway. 12.6.11 pseudo-stop exit without limp home mode, clock monitor enabled (nolhm=1, cme=1, dly=x) if the nolhm bit is set and the cme (or fcme) bits are set, a clock monitor failure is detected when a stop instruction is executed and the mcu resets via the clock monitor reset vector. 12.6.12 pseudo-stop exit without limp home mode, clock monitor disabled (nolhm=1, cme=0, dly=1) if nolhm is set to 1 and the cme and fcme bits are cleared, the limp home clock is not used. in this mode, crystal activity is the only method by which the device may recover from pseudo-stop. the device will start execution with the extali clock following 4096 xclk cycles.
clock functions advance information 68hc(9)12d60 ? rev 3.0 160 clock functions motorola (nolhm=1, cme=0, dly=0) if nolhm is set to 1 and the cme and fcme bits are cleared, the limp home clock is not used. in this mode, crystal activity is the only method by which the device may recover from pseudo-stop. the device will start execution with the extali clock following 16 xclk cycles. caution: due to switching of the clock this configuration is not recommended. 12.6.13 summary of stop and pseudo-stop mode exit conditions table 12-1 and table 12-2 summarise the exit conditions from stop and pseudo-stop modes using interrupt, key-interrupt and xirq. a short reset pulse should not be used to exit stop or pseudo-stop mode because limp home mode is automatically entered after reset (when v ddpll =v dd ). the reset wakeup pulse must be longer than the oscillator startup time (as in power on reset) in order to remove the risk of code runaway.
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 161 .. table 12-1. summary of stop mode exit conditions mode conditions summary stop exit without limp home mode, clock monitor disabled nolhm=1 cme=0 dly=x oscillator must be stable within 4096 xclk cycles. xclk can be modified by slow divider register. use of dly=0 only recommended with external clock. executing the stop instruction without limp home mode, clock monitor enabled nolhm=1 cme=1 dly=x when a stop instruction is executed the mcu resets via the clock monitor reset vector. stop exit in limp home mode with delay nolhm=0 cme=x dly=1 oscillator must be stable within 4096 f vcomin cycles or there is a possibility of code runaway as the clock monitor circuit can be misled by extali clock into reporting a good signal before it has fully stabilised stop exit in limp home mode without delay (fast stop recovery) nolhm=0 cme=x dly=0 this mode is only recommended for use with an external clock source. table 12-2. summary of pseudo stop mode exit conditions mode conditions summary pseudo-stop exit in limp home mode with delay nolhm=0 cme=x dly=1 cpu exits stop in limp home mode and oscillator running. if the oscillator fails during pseudo-stop and then recovers there is a possibility of code runaway as the clock monitor circuit can be misled by extali clock into reporting a good signal before it has fully stabilised pseudo-stop exit in limp home mode without delay (fast stop recovery) nolhm=0 cme=x dly=0 this mode is not recommended as it is possible that the initial vco clock frequency may be high enough to cause code runaway. pseudo-stop exit without limp home mode, clock monitor enabled nolhm=1 cme=1 dly=x when a stop instruction is executed the mcu resets via the clock monitor reset vector. pseudo-stop exit without limp home mode, clock monitor disabled, with delay nolhm=1 cme=0 dly=1 oscillator starts operation following 4096 xclk cycles (actual controlled by slow mode divider). pseudo-stop exit without limp home mode, clock monitor disabled, without delay nolhm=1 cme=0 dly=0 this mode is only recommended for use with an external clock source.
clock functions advance information 68hc(9)12d60 ? rev 3.0 162 clock functions motorola 12.6.14 pll register descriptions read anytime, write anytime, except when bcsp = 1 (pll selected as bus clock). if the pll is on, the count in the loop divider (synr) register effectively multiplies up the bus frequency from the pll reference frequency by synr + 1. internally, sysclk runs at twice the bus frequency. caution should be used not to exceed the maximum rated operating frequency for the cpu. read anytime, write anytime, except when bcsp = 1. the reference divider bits provides a finer granularity for the pll multiplier steps. the reference frequency is divided by refdv + 1. always reads zero, except in test modes. bit 7654321bit 0 0 0 syn5 syn4 syn3 syn2 syn1 syn0 reset: 0 0 0 0 0 0 0 0 synr ? synthesizer register $0038 bit 7654321bit 0 0 0 0 0 0 refdv2 refdv1 refdv0 reset: 0 0 000000 refdv ? reference divider register $0039 bit 7654321bit 0 tstout7 tstout6 tstout5 tstout4 tstout3 tstout2 tstout1 tstout0 reset: 0 0 000000 cgtflg ? clock generator test register $003a
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 163 read anytime, refer to each bit for write conditions. lockif ? pll lock interrupt flag 0 = no change in lock bit. 1 = lock condition has changed, either from a locked state to an unlocked state or vice versa. to clear the flag, write one to this bit in pllflg. cleared in limp-home mode. lock ? locked phase lock loop circuit regardless of the bandwidth control mode (automatic or manual): 0 = pll vco is not within the desired tolerance of the target frequency. 1 = after the phase lock loop circuit is turned on, indicates the pll vco is within the desired tolerance of the target frequency. write has no effect on lock bit. this bit is cleared in limp-home mode as the lock detector cannot operate without the reference frequency. lhif ? limp-home interrupt flag 0 = no change in lhome bit. 1 = lhome condition has changed, either entered or exited limp- home mode. to clear the flag, write one to this bit in pllflg. lhome ? limp-home mode status 0 = mcu is operating normally, with extali clock available for generating clocks or as pll reference. 1 = loss of reference clock. cgm delivers pll vco limp-home frequency to the mcu. for limp-home mode, see limp-home and fast stop recovery modes . bit 7654321bit 0 lockif lock 0 0 0 0 lhif lhome reset: 0 0 0 0 0 0 0 0 pllflg ? pll flags $003b
clock functions advance information 68hc(9)12d60 ? rev 3.0 164 clock functions motorola read and write anytime. exceptions are listed below for each bit. lockie ? pll lock interrupt enable 0 = pll lock interrupt is disabled 1 = pll lock interrupt is enabled forced to 0 when vddpll=0. pllon ? phase lock loop on 0 = turns the pll off. 1 = turns on the phase lock loop circuit. if auto is set, the pll will lock automatically. cannot be cleared when bcsp = 1 (pll selected as bus clock). forced to 0 when vddpll is at vss level. in limp-home mode, the output of pllon is forced to 1, but the pllon bit reads the latched value. auto ? automatic bandwidth control 0 = automatic mode control is disabled and the pll is under software control, using acq bit. 1 = automatic mode control is enabled. acq bit is read only. automatic bandwidth control selects either the high bandwidth (acquisition) mode or the low bandwidth (tracking) mode depending on how close to the desired frequency the vco is running. see electrical specifications . bit 7654321bit 0 lockie pllon auto acq 0 pstp lhie nolhm reset: 0 ? (1) 10000 ? (2) pllcr ? pll control register $003c 1. set when vddpll power supply is high. forced to 0 when vddpll is low. 2. cleared when vddpll power supply is high. forced to 1 when vddpll is low.
clock functions limp-home and fast stop recovery modes 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 165 acq ? not in acquisition if auto = 1 (acq is read only) 0 = pll vco is not within the desired tolerance of the target frequency. the loop filter is in high bandwidth, acquisition mode. 1 = after the phase lock loop circuit is turned on, indicates the pll vco is within the desired tolerance of the target frequency. the loop filter is in low bandwidth, tracking mode. if auto = 0 0 = high bandwidth pll loop selected 1 = low bandwidth pll loop selected pstp ? pseudo-stop enable 0 = pseudo-stop oscillator mode is disabled 1 = pseudo-stop oscillator mode is enabled in pseudo-stop mode, the oscillator is still running while the mcu is maintained in stop mode. this allows for a faster stop recovery and reduces the mechanical stress and aging of the resonator in case frequent stop conditions at the expense of a slightly increased power consumption. lhie ? limp-home interrupt enable 0 = limp-home interrupt is disabled 1 = limp-home interrupt is enabled forced to 0 when vddpll is at vss level. nolhm ? no limp-home mode 0 = loss of reference clock forces the mcu in limp-home mode. 1 = loss of reference clock causes standard clock monitor reset. read anytime; normal modes: write once; special modes: write anytime. forced to 1 when vddpll is at vss level.
clock functions advance information 68hc(9)12d60 ? rev 3.0 166 clock functions motorola read and write anytime. exceptions are listed below for each bit. bcsp and bcss bits determine the clock used by the main system including the cpu and buses. bcsp ? bus clock select pll 0 = sysclk is derived from the crystal clock or from slwclk. 1 = sysclk source is the pll. cannot be set when pllon = 0. in limp-home mode, the output of bcsp is forced to 1, but the bcsp bit reads the latched value. bcss ? bus clock select slow 0 = sysclk is derived from the crystal clock extali. 1 = sysclk source is the slow clock slwclk. this bit has no effect when bcsp is set. mcs ? module clock select 0 = m clock is the same as pclk. 1 = m clock is derived from slow clock slwclk. this bit determines the clock used by the ect module and the baud rate generators of the scis. in limp-home mode, the output of mcs is forced to 0, but the mcs bit reads the latched value. bit 7654321bit 0 0 bcsp bcss 0 0 mcs 0 0 reset: 0 0 0 0 0 0 0 0 clksel ? clock generator clock select register $003d
clock functions system clock frequency formulas 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 167 read and write anytime. a write to this register changes the slwclk frequency with minimum delay (less than one slwclk cycle), thus allowing immediate tune- up of the performance versus power consumption for the modules using this clock. the frequency divide ratio is 2 times (slow), hence the divide range is 2 to 126 (not on first pass products). when slow = 0, the divider is bypassed. the generation of e, p and m clocks further divides slwclk by 2. hence, the final ratio of bus to extali frequency is programmable to 2, 4, 8, 12, 16, 20, ..., 252, by steps of 4. slwclk is a 50% duty cycle signal. 12.7 system clock frequency formulas see figure 12-6 : slwclk = extali / ( 2 x slow ) slow = 1,2,..63 slwclk = extali slow = 0 pllclk = 2 x extali x (synr + 1) / (refdv + 1) eclk = sysclk / 2 xclk = slwclk / 2 pclk = sysclk / 2 bclk (1) = extali / 2 boolean equations: bit 7654321bit 0 0 0 sldv5 sldv4 sldv3 sldv2 sldv1 sldv0 reset: 0 0 0 0 0 0 0 0 slow ? slow mode divider register $003e 1. if sysclk is slower than extali (bcss=1, bcsp=0, slow>0), bclk becomes eclk.
clock functions advance information 68hc(9)12d60 ? rev 3.0 168 clock functions motorola sysclk = (bcsp & pllclk) | (bcsp & bcss & extali) | (bcsp & bcss & slwclk) mclk = (pclk & mcs ) | (xclk & mcs) mscan system = (extali & clksrc) | (sysclk & clksrc) bdm system = (bclk & clksw) | (eclk & clksw) note: during limp-home mode pclk, eclk, bclk, mclk and xclk are supplied by vco (pllclk). 12.8 clock divider chains figure 12-6 , figure 12-7 , figure 12-8 , and figure 12-9 summarize the clock divider chains for the various peripherals on the 68hc(9)12d60.
clock functions clock divider chains 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 169 figure 12-6. clock generation chain bus clock select bits bcsp and bcss in the clock select register (clksel) determine which clock drives sysclk for the main system including the cpu and buses. bcss has no effect if bcsp is set. during reduced consumption oscillator phase lock loop extal xtal 0:0 sysclk to buses, spi, pwm, atd0, atd1 to rti, cop bcsp bcss slow mode clock divider extali extali extali slwclk pllclk 0:1 bcsp bcss 1:x bcsp bcss mcs = 0 mcs = 1 2 2 to mscan clksrc = 1 tclks t clock generator e and p clock generator pclk eclk xclk to sci0, sci1, ect to cpu sync mclk to bdm 2 sync to cal to clock monitor clksrc = 0 clksw = 0 clksw = 1 bdmclk
clock functions advance information 68hc(9)12d60 ? rev 3.0 170 clock functions motorola the transition, the clock select output will be held low and all cpu activity will cease until the transition is complete. the module clock select bit mcs determines the clock used by the ect module and the baud rate generators of the scis. in limp-home mode, the output of mcs is forced to 0, but the mcs bit reads the latched value. it allows normal operation of the serial and timer subsystems at a fixed reference frequency while allowing the cpu to operate at a higher, variable frequency. figure 12-7. clock chain for sci0, sci1, rti, cop xclk sc0bd modulus divider: 1, 2, 3, 4, 5, 6,...,8190, 8191 sci0 receive baud rate (16x) sci0 transmit baud rate (1x) bits: rtr2, rtr1, rtr0 to rti bits: cr2, cr1, cr0 to cop 16 sci1 receive baud rate (16x) sci1 transmit baud rate (1x) 16 0:0:0 0:0:1 0:1:0 0:1:1 1:0:0 1:0:1 1:1:0 1:1:1 2 2 2 2 2 2 0:0:0 0:0:1 0:1:0 0:1:1 1:0:0 1:0:1 1:1:0 1:1:1 4 4 4 2 4 2 4 register: copctl register: rtictl sc1bd modulus divider: 1, 2, 3, 4, 5, 6,...,8190, 8191 register: rtictl bit:rtbyp 2048 mclk
clock functions clock divider chains 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 171 figure 12-8. clock chain for ect bits: pr2, pr1, pr0 mclk pamod paclk pulse acc low byte paclk/256 pulse acc high byte paclk/65536 (paov) gate logic bits: paen, clk1, clk0 ten register: pactl register: tmsk2 paen 0:0:0 0:0:1 2 0:1:0 2 0:1:1 2 1:0:0 2 1:0:1 2 1:1:0 2 1:1:1 2 bits: mcpr1, mcpr0 mcen register: mcctl 0:0 0:1 4 1:0 2 1:1 2 0:x:x 1:0:0 1:0:1 1:1:0 1:1:1 to timer main counter (tcnt) modulus down counter port t7 prescaled mclk
clock functions advance information 68hc(9)12d60 ? rev 3.0 172 clock functions motorola figure 12-9. clock chain for mscan, spi, atd0, atd1 and bdm 12.9 computer operating properly (cop) the cop or watchdog timer is an added check that a program is running and sequencing properly. when the cop is being used, software is responsible for keeping a free running watchdog timer from timing out. if the watchdog timer times out it is an indication that the software is no longer being executed in the intended sequence; thus a system reset is initiated. three control bits allow selection of seven cop time-out periods. when cop is enabled, sometime during the selected period the program must write $55 and $aa (in this order) to the coprst register. if the program fails to do this the part will reset. if any value other than $55 or $aa is written, the part is reset. pclk bits : spr2, spr1, spr0 spi bit rate 5-bit modulus counter (pr0-pr4) to atd0 and atd1 bkgd bdm bit clock: receive: detect falling edge, count 12 eclks, sample input transmit 1: detect falling edge, count 6 eclks while output is high impedance, drive out 1 e cycle pulse high, high imped- ance output again transmit 0: detect falling edge, drive out low, count 9 eclks, drive out 1 e cycle pulse high, high impedance output pin synchronizer logic bkgd in bkgd out bkgd direction 2 0:0:0 0:0:1 0:1:0 0:1:1 1:0:0 1:0:1 1:1:0 1:1:1 2 2 2 2 2 2 2 2 register: sp0br mscan clock clksrc extali sysclk clksw eclk bclk
clock functions real-time interrupt 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 173 in addition, windowed cop operation can be selected. in this mode, writes to the coprst register must occur in the last 25% of the selected period. a premature write will also reset the part. 12.10 real-time interrupt there is a real time (periodic) interrupt available to the user. this interrupt will occur at one of seven selected rates. an interrupt flag and an interrupt enable bit are associated with this function. there are three bits for the rate select. 12.11 clock monitor the clock monitor circuit is based on an internal resistor-capacitor (rc) time delay. if no extali clock edges are detected within this rc time delay, the clock monitor can optionally generate a system reset. the clock monitor function is enabled/disabled by the cme control bit in the copctl register. this time-out is based on an rc delay so that the clock monitor can operate without any extali clock. clock monitor time-outs are shown in table 12-3 . the corresponding extali clock period with an ideal 50% duty cycle is twice this time-out value. table 12-3. clock monitor time-outs supply range 5 v +/ ? 10% 2 ? 20 s
clock functions advance information 68hc(9)12d60 ? rev 3.0 174 clock functions motorola 12.12 clock function registers all register addresses shown reflect the reset state. registers may be mapped to any 2k byte space. rtie ? real time interrupt enable read and write anytime. 0 = interrupt requests from rti are disabled. 1 = interrupt will be requested whenever rtif is set. rswai ? rti and cop stop while in wait write once in normal modes, anytime in special modes. read anytime. 0 = allows the rti and cop to continue running in wait. 1 = disables both the rti and cop whenever the part goes into wait. rsbck ? rti and cop stop while in background debug mode write once in normal modes, anytime in special modes. read anytime. 0 = allows the rti and cop to continue running while in background mode. 1 = disables both the rti and cop when the part is in background mode. this is useful for emulation. rtbyp ? real time interrupt divider chain bypass write not allowed in normal modes, anytime in special modes. read anytime. 0 = divider chain functions normally. 1 = divider chain is bypassed, allows faster testing (the divider chain is normally xclk divided by 2 13 , when bypassed becomes xclk divided by 4). bit 7654321bit 0 rtie rswai rsbck reserved rtbyp rtr2 rtr1 rtr0 reset:00000000 rtictl ? real-time interrupt control register $0014
clock functions clock function registers 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 175 rtr2, rtr1, rtr0 ? real-time interrupt rate select read and write anytime. rate select for real-time interrupt. the clock used for this module is the xclk. rtif ? real time interrupt flag this bit is cleared automatically by a write to this register with this bit set. 0 = time-out has not yet occurred. 1 = set when the time-out period is met. table 12-4. real time interrupt rates rtr2 rtr1 rtr0 divide x by: time-out period x = 125 khz time-out period x = 500 khz time-out period x = 2.0 mhz time-out period x = 8.0 mhz 0 0 0 off off off off off 001 2 13 65.536 ms 16.384 ms 4.096 ms 1.024 ms 010 2 14 131.72 ms 32.768 ms 8.196 ms 2.048 ms 011 2 15 263.44 ms 65.536 ms 16.384 ms 4.096 ms 100 2 16 526.88 ms 131.72 ms 32.768 ms 8.196 ms 101 2 17 1.05 s 263.44 ms 65.536 ms 16.384 ms 110 2 18 2.11 s 526.88 ms 131.72 ms 32.768 ms 111 2 19 4.22 s 1.05 s 263.44 ms 65.536 ms bit 7654321bit 0 rtif0000000 reset: 0 0 0 0 0 0 0 0 rtiflg ? real time interrupt flag register $0015
clock functions advance information 68hc(9)12d60 ? rev 3.0 176 clock functions motorola cme ? clock monitor enable read and write anytime. if fcme is set, this bit has no meaning nor effect. 0 = clock monitor is disabled. slow clocks and stop instruction may be used. 1 = slow or stopped clocks (including the stop instruction) will cause a clock reset sequence or limp-home mode. see limp- home and fast stop recovery modes . on reset cme is 1 if vddpll is high cme is 0 if vddpll is low. note: the vddpll-dependent reset operation is not implemented on first pass products. in this case the state of cme on reset is 0. fcme ? force clock monitor enable write once in normal modes, anytime in special modes. read anytime. in normal modes, when this bit is set, the clock monitor function cannot be disabled until a reset occurs. 0 = clock monitor follows the state of the cme bit. 1 = slow or stopped clocks will cause a clock reset sequence or limp-home mode. see limp-home and fast stop recovery modes . bit 7654321bit 0 cme fcme fcmcop wcop disr cr2 cr1 cr0 reset: 0/1 0 000111normal reset: 0/1 0 001111special copctl ? cop control register $0016
clock functions clock function registers 68hc(9)12d60 ? rev 3.0 advance information motorola clock functions 177 fcmcop ? force clock monitor reset or cop watchdog reset writes are not allowed in normal modes, anytime in special modes. read anytime. if disr is set, this bit has no effect. 0 = normal operation. 1 = a clock monitor failure reset or a cop failure reset is forced depending on the state of cme and if cop is enabled. wcop ? window cop mode write once in normal modes, anytime in special modes. read anytime. 0 = normal cop operation 1 = window cop operation when set, a write to the coprst register must occur in the last 25% of the selected period. a premature write will also reset the part. as long as all writes occur during this window, $55 can be written as often as desired. once $aa is written the time-out logic restarts and the user must wait until the next window before writing to coprst. please note, there is a fixed time uncertainty about the exact cop counter state when reset, as the initial prescale clock divider in the rti section is not cleared when the cop counter is cleared. this means the effective window is reduced by this uncertainty. table 12- 5 below shows the exact duration of this window for the seven available cop rates. cme cop enabled forced reset 0 0 none 01 cop failure 1 0 clock monitor failure 11 both (1) 1. highest priority interrupt vector is serviced.
clock functions advance information 68hc(9)12d60 ? rev 3.0 178 clock functions motorola disr ? disable resets from cop watchdog and clock monitor writes are not allowed in normal modes, anytime in special modes. read anytime. 0 = normal operation. 1 = regardless of other control bit states, cop and clock monitor will not generate a system reset. cr2, cr1, cr0 ? cop watchdog timer rate select bits these bits select the cop time-out rate. the clock used for this module is the xclk. write once in normal modes, anytime in special modes. read anytime. table 12-5. cop watchdog rates cr2 cr1 cr0 divide x clock by 8.0 mhz x clock. time-out window cop enabled: window start (1) window end effective window (2) 0 0 0 off off off off off 001 2 13 1.024 ms -0/+0.256 ms 0.768 ms 0.768 ms 0% (3) 010 2 15 4.096 ms -0/+0.256 ms 3.072 ms 3.840 ms 18.8 % 011 2 17 16.384 ms -0/+0.256 ms 12.288 ms 16.128 ms 23.4 % 100 2 19 65.536 ms -0/+1.024 ms 49.152 ms 64.512 ms 23.4 % 101 2 21 262.144 ms -0/+1.024 ms 196.608 ms 261.120 ms 24.6 % 110 2 22 524.288 ms -0/+1.024 ms 393.216 ms 523.264 ms 24.8 % 111 2 23 1.048576 ms -0/+1.024 ms 786.432 ms 1.047552 ms 24.9 % 1. time for writing $55 following previous cop restart of time-out logic due to writing $aa. 2. please refer to wcop bit description above. 3. window cop cannot be used at this rate.
clock functions advance information 68hc(9)12d60 ? rev 3.0 179 clock functions motorola always reads $00. writing $55 to this address is the first step of the cop watchdog sequence. writing $aa to this address is the second step of the cop watchdog sequence. other instructions may be executed between these writes but both must be completed in the correct order prior to time-out to avoid a watchdog reset. writing anything other than $55 or $aa causes a cop reset to occur. bit 7654321bit 0 bit 7654321bit 0 reset: 00000000 coprst ? arm/reset cop timer register $0017
clock functions advance information 68hc(9)12d60 ? rev 3.0 180 clock functions motorola
68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 181 advance information ? 68hc(9)12d60 section 13. pulse width modulator 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 13.3 pwm register description . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 13.4 pwm boundary cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 13.2 introduction the pulse-width modulator (pwm) subsystem provides four independent 8-bit pwm waveforms or two 16-bit pwm waveforms or a combination of one 16-bit and two 8-bit pwm waveforms. each waveform channel has a programmable period and a programmable duty-cycle as well as a dedicated counter. a flexible clock select scheme allows four different clock sources to be used with the counters. each of the modulators can create independent, continuous waveforms with software-selectable duty rates from 0 percent to 100 percent. the pwm outputs can be programmed as left-aligned outputs or center-aligned outputs. the period and duty registers are double buffered so that if they change while the channel is enabled, the change will not take effect until the counter rolls over or the channel is disabled. if the channel is not enabled, then writes to the period and/or duty register will go directly to the latches as well as the buffer, thus ensuring that the pwm output will always be either the old waveform or the new waveform, not some variation in between. a change in duty or period can be forced into immediate effect by writing the new value to the duty and/or period registers and then writing to the counter. this causes the counter to reset and the new duty and/or period values to be latched. in addition, since the counter is readable it is
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 182 pulse width modulator motorola possible to know where the count is with respect to the duty value and software can be used to make adjustments by turning the enable bit off and on. the four pwm channel outputs share general-purpose port p pins. enabling pwm pins takes precedence over the general-purpose port. when pwm channels are not in use, the port pins may be used for discrete input/output. figure 13-1. block diagram of pwm left-aligned output channel gate pwcntx 8-bit compare = pwdtyx 8-bit compare = pwperx up /down from port p data register to pin driver ppolx clock source (eclk or scaled eclk) (clock edge sync) reset centr = 0 mux mux s r q q pwper pwdty pwenx ppol = 0 ppol = 1 sync
pulse width modulator introduction 68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 183 figure 13-2. block diagram of pwm center-aligned output channel gate pwcntx 8-bit compare = pwdtyx 8-bit compare = pwperx reset from port p data register to pin driver ppolx clock source (eclk or scaled eclk) (clock edge sync) up /down centr = 1 mux mux t q q pwdty pwenx ppol = 1 ppol = 0 (duty cycle) (period) pwper 2 (pwper ? pwdty) 2 pwdty sync
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 184 pulse width modulator motorola figure 13-3. pwm clock sources 13.3 pwm register description read and write anytime. 8-bit down counter pclk2 mux pclk3 mux clock to pwm channel 2 clock to pwm channel 3 2 pwscnt1 8-bit scale register pwscal1 clock b clock s1** **clock s1 = b/2 * (pwscal1 + 1) 2 0:0:0 0:0:1 0:1:0 0:1:1 1:0:0 1:0:1 1:1:0 1:1:1 2 2 2 2 2 2 0:0:0 0:0:1 0:1:0 0:1:1 1:0:0 1:0:1 1:1:0 1:1:1 8-bit down counter pclk0 mux pclk1 mux clock to pwm channel 0 clock to pwm channel 1 2 pwscnt0 8-bit scale register pwscal0 clock a clock s0* *clock s0 = a/2 * (pwscal0 + 1) register: bits: pckb2, pckb0 pckb1, = 0 = 0 bits: pcka2, pcka0 pcka1, pwpres psbck limbdm eclk psbck is bit 0 of pwctl register. internal signal limbdm is ?1? if the mcu is in background debug mode. bit 7654321bit 0 con23 con01 pcka2 pcka1 pcka0 pckb2 pckb1 pckb0 reset: 0 0 0 0 0 0 0 0 pwclk ? pwm clocks and concatenate $0040
pulse width modulator pwm register description 68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 185 con23 ? concatenate pwm channels 2 and 3 when concatenated, channel 2 becomes the high-order byte and channel 3 becomes the low-order byte. channel 2 output pin is used as the output for this 16-bit pwm (bit 2 of port p). channel 3 clock- select control bits determines the clock source. channel 3 output pin becomes a general purpose i/o. 0 = channels 2 and 3 are separate 8-bit pwms. 1 = channels 2 and 3 are concatenated to create one 16-bit pwm channel. con01 ? concatenate pwm channels 0 and 1 when concatenated, channel 0 becomes the high-order byte and channel 1 becomes the low-order byte. channel 0 output pin is used as the output for this 16-bit pwm (bit 0 of port p). channel 1 clock- select control bits determine the clock source. channel 1 output pin becomes a general purpose i/o. 0 = channels 0 and 1 are separate 8-bit pwms. 1 = channels 0 and 1 are concatenated to create one 16-bit pwm channel. pcka2 ? pcka0 ? prescaler for clock a clock a is one of two clock sources which may be used for channels 0 and 1. these three bits determine the rate of clock a, as shown in table 13-1 .
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 186 pulse width modulator motorola pckb2 ? pckb0 ? prescaler for clock b clock b is one of two clock sources which may be used for channels 2 and 3. these three bits determine the rate of clock b, as shown in table 13-1 . read and write anytime. pclk3 ? pwm channel 3 clock select 0 = clock b is the clock source for channel 3. 1 = clock s1 is the clock source for channel 3. pclk2 ? pwm channel 2 clock select 0 = clock b is the clock source for channel 2. 1 = clock s1 is the clock source for channel 2. pclk1 ? pwm channel 1 clock select 0 = clock a is the clock source for channel 1. 1 = clock s0 is the clock source for channel 1. table 13-1. clock a and clock b prescaler pcka2 (pckb2) pcka1 (pckb1) pcka0 (pckb0) value of clock a (b) 000 p 001 p 2 010 p 4 011 p 8 100p 16 101p 32 110p 64 111p 128 bit 7654321bit 0 pclk3 pclk2 pclk1 pclk0 ppol3 ppol2 ppol1 ppol0 reset: 0 0 0 0 0 0 0 0 pwpol ? pwm clock select and polarity $0041
pulse width modulator pwm register description 68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 187 pclk0 ? pwm channel 0 clock select 0 = clock a is the clock source for channel 0. 1 = clock s0 is the clock source for channel 0. if a clock select is changed while a pwm signal is being generated, a truncated or stretched pulse may occur during the transition. the following four bits apply in left-aligned mode only: ppol3 ? pwm channel 3 polarity 0 = channel 3 output is low at the beginning of the period; high when the duty count is reached. 1 = channel 3 output is high at the beginning of the period; low when the duty count is reached. ppol2 ? pwm channel 2 polarity 0 = channel 2 output is low at the beginning of the period; high when the duty count is reached. 1 = channel 2 output is high at the beginning of the period; low when the duty count is reached. ppol1 ? pwm channel 1 polarity 0 = channel 1 output is low at the beginning of the period; high when the duty count is reached. 1 = channel 1 output is high at the beginning of the period; low when the duty count is reached. ppol0 ? pwm channel 0 polarity 0 = channel 0 output is low at the beginning of the period; high when the duty count is reached. 1 = channel 0 output is high at the beginning of the period; low when the duty count is reached. depending on the polarity bit, the duty registers may contain the count of either the high time or the low time. if the polarity bit is zero and left alignment is selected, the duty registers contain a count of the low time. if the polarity bit is one, the duty registers contain a count of the high time.
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 188 pulse width modulator motorola setting any of the pwenx bits causes the associated port p line to become an output regardless of the state of the associated data direction register (ddrp) bit. this does not change the state of the data direction bit. when pwenx returns to zero, the data direction bit controls i/o direction. on the front end of the pwm channel, the scaler clock is enabled to the pwm circuit by the pwenx enable bit being high. when all four pwm channels are disabled, the prescaler counter shuts off to save power. there is an edge-synchronizing gate circuit to guarantee that the clock will only be enabled or disabled at an edge. read and write anytime. pwen3 ? pwm channel 3 enable the pulse modulated signal will be available at port p, bit 3 when its clock source begins its next cycle. 0 = channel 3 is disabled. 1 = channel 3 is enabled. pwen2 ? pwm channel 2 enable the pulse modulated signal will be available at port p, bit 2 when its clock source begins its next cycle. 0 = channel 2 is disabled. 1 = channel 2 is enabled. pwen1 ? pwm channel 1 enable the pulse modulated signal will be available at port p, bit 1 when its clock source begins its next cycle. 0 = channel 1 is disabled. 1 = channel 1 is enabled. bit 7654321bit 0 0000pwen3pwen2pwen1pwen0 reset: 00000000 pwen ? pwm enable $0042
pulse width modulator pwm register description 68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 189 pwen0 ? pwm channel 0 enable the pulse modulated signal will be available at port p, bit 0 when its clock source begins its next cycle. 0 = channel 0 is disabled. 1 = channel 0 is enabled. pwpres is a free-running 7-bit counter. read anytime. write only in special mode (smod = 1). read and write anytime. a write will cause the scaler counter pwscnt0 to load the pwscal0 value unless in special mode with discal = 1 in the pwtst register. pwm channels 0 and 1 can select clock s0 (scaled) as its input clock by setting the control bit pclk0 and pclk1 respectively. clock s0 is generated by dividing clock a by the value in the pwscal0 register + 1 and dividing again by two. when pwscal0 = $ff, clock a is divided by 256 then divided by two to generate clock s0. bit 7654321bit 0 0bit 654321bit 0 reset: 0 0 0 0 0 0 0 0 pwpres ? pwm prescale counter $0043 bit 7654321bit 0 bit 7654321bit 0 reset: 0 0 0 0 0 0 0 0 pwscal0 ? pwm scale register 0 $0044
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 190 pulse width modulator motorola pwscnt0 is a down-counter that, upon reaching $00, loads the value of pwscal0. read any time. read and write anytime. a write will cause the scaler counter pwscnt1 to load the pwscal1 value unless in special mode with discal = 1 in the pwtst register. pwm channels 2 and 3 can select clock s1 (scaled) as its input clock by setting the control bit pclk2 and pclk3 respectively. clock s1 is generated by dividing clock b by the value in the pwscal1 register + 1 and dividing again by two. when pwscal1 = $ff, clock b is divided by 256 then divided by two to generate clock s1. pwscnt1 is a down-counter that, upon reaching $00, loads the value of pwscal1. read any time. bit 7654321bit 0 bit 7654321bit 0 reset: 0 0 0 0 0 0 0 0 pwscnt0 ? pwm scale counter 0 value $0045 bit 7654321bit 0 bit 7654321bit 0 reset: 0 0 000000 pwscal1 ? pwm scale register 1 $0046 bit 7654321bit 0 bit 7654321bit 0 reset: 0 0 000000 pwscnt1 ? pwm scale counter 1 value $0047
pulse width modulator pwm register description 68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 191 read and write anytime. a write will cause the pwm counter to reset to $00. in special mode, if discr = 1, a write does not reset the pwm counter. the pwm counters are not reset when pwm channels are disabled. the counters must be reset prior to a new enable. each counter may be read any time without affecting the count or the operation of the corresponding pwm channel. writes to a counter cause the counter to be reset to $00 and force an immediate load of both duty and period registers with new values. to avoid a truncated pwm period, write to a counter while the counter is disabled. in left-aligned output mode, resetting the counter and starting the waveform output is controlled by a match between the period register and the value in the counter. in center-aligned output mode the counters operate as up/down counters, where a match in period changes the counter direction. the duty register changes the state of the output during the period to determine the duty. when a channel is enabled, the associated pwm counter starts at the count in the pwcntx register using the clock selected for that channel. in special mode, when discp = 1 and configured for left-aligned output, a match of period does not reset the associated pwm counter. bit 7654321bit 0 pwcnt0 bit 7654321bit 0 $0048 pwcnt1 bit 7654321bit 0 $0049 pwcnt2 bit 7654321bit 0 $004a pwcnt3 bit 7654321bit 0 $004b reset:00000000 pwcntx ? pwm channel counters
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 192 pulse width modulator motorola read and write anytime. the value in the period register determines the period of the associated pwm channel. if written while the channel is enabled, the new value will not take effect until the existing period terminates, forcing the counter to reset. the new period is then latched and is used until a new period value is written. reading this register returns the most recent value written. to start a new period immediately, write the new period value and then write the counter forcing a new period to start with the new period value. period = channel-clock-period (pwper + 1) (centr = 0) period = channel-clock-period (2 pwper) (centr = 1) read and write anytime. bit 7654321bit 0 pwper0 bit 7654321bit 0 $004c pwper1 bit 7654321bit 0 $004d pwper2 bit 7654321bit 0 $004e pwper3 bit 7654321bit 0 $004f reset: 11111111 pwperx ? pwm channel period registers bit 7654321bit 0 pwdty0 bit 7654321bit 0 $0050 pwdty1 bit 7654321bit 0 $0051 pwdty2 bit 7654321bit 0 $0052 pwdty3 bit 7654321bit 0 $0053 reset:11111111 pwdtyx ? pwm channel duty registers
pulse width modulator pwm register description 68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 193 the value in each duty register determines the duty of the associated pwm channel. when the duty value is equal to the counter value, the output changes state. if the register is written while the channel is enabled, the new value is held in a buffer until the counter rolls over or the channel is disabled. reading this register returns the most recent value written. if the duty register is greater than or equal to the value in the period register, there will be no duty change in state. if the duty register is set to $ff the output will always be in the state which would normally be the state opposite the ppolx value. left-aligned-output mode (centr = 0): duty cycle = [(pwdtyx + 1) / (pwperx + 1)] 100% (ppolx = 1) duty cycle = [(pwperx ? pwdtyx) / (pwperx+1)] 100% (ppolx = 0) center-aligned-output mode (centr = 1): duty cycle = [(pwperx ? pwdtyx) / pwperx] 100% (ppolx = 0) duty cycle = [pwdtyx / pwperx] 100% (ppolx = 1) read and write anytime. pswai ? pwm halts while in wait mode 0 = allows pwm main clock generator to continue while in wait mode. 1 = halt pwm main clock generator when the part is in wait mode. centr ? center-aligned output mode to avoid irregularities in the pwm output mode, write the centr bit only when pwm channels are disabled. 0 = pwm channels operate in left-aligned output mode 1 = pwm channels operate in center-aligned output mode bit 7654321bit 0 0 0 0 pswai centr rdpp pupp psbck reset: 00000000 pwctl ? pwm control register $0054
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 194 pulse width modulator motorola rdpp ? reduced drive of port p 0 = all port p output pins have normal drive capability. 1 = all port p output pins have reduced drive capability. pupp ? pull-up port p enable 0 = all port p pins have an active pull-up device disabled. 1 = all port p pins have an active pull-up device enabled. psbck ? pwm stops while in background mode 0 = allows pwm to continue while in background mode. 1 = disable pwm input clock when the part is in background mode. read anytime but write only in special mode (smodn = 0). these bits are available only in special mode and are reset in normal mode. discr ? disable reset of channel counter on write to channel counter 0 = normal operation. write to pwm channel counter will reset channel counter. 1 = write to pwm channel counter does not reset channel counter. discp ? disable compare count period 0 = normal operation 1 = in left-aligned output mode, match of period does not reset the associated pwm counter register. discal ? disable load of scale-counters on write to the associated scale-registers 0 = normal operation 1 = write to pwscal0 and pwscal1 does not load scale counters bit 7654321bit 0 discr discp discal 0 0 0 0 0 reset: 0 0 0 0 0 0 0 0 pwtst ? pwm special mode register ( ? test ? ) $0055
pulse width modulator pwm register description 68hc(9)12d60 ? rev 3.0 advance information motorola pulse width modulator 195 portp can be read anytime. pwm functions share port p pins 3 to 0 and take precedence over the general-purpose port when enabled. when configured as input, a read will return the pin level. when configured as output, a read will return the latched output data. a write will drive associated pins only if configured for output and the corresponding pwm channel is not enabled. after reset, all pins are general-purpose, high-impedance inputs. ddrp determines pin direction of port p when used for general-purpose i/o. read and write anytime. ddrp[7:0] ? data direction port p pin 7-0 0 = i/o pin configured as high impedance input 1 = i/o pin configured for output. bit 7654321bit 0 pp7 pp6 pp5 pp4 pp3 pp2 pp1 pp0 pwm ???? pwm3 pwm2 pwm1 pwm0 reset: ???????? portp ? port p data register $0056 bit 7654321bit 0 ddp7 ddp6 ddp5 ddp4 ddp3 ddp2 ddp1 ddp0 reset: 00000000 ddrp ? port p data direction register $0057
pulse width modulator advance information 68hc(9)12d60 ? rev 3.0 196 pulse width modulator motorola 13.4 pwm boundary cases the boundary conditions for the pwm channel duty registers and the pwm channel period registers cause these results: table 13-2. pwm left-aligned boundary conditions pwdtyx pwperx ppolx output $ff > $00 1 low $ff > $00 0 high pwperx ? 1high pwperx ? 0low ? $00 1 high ? $00 0 low table 13-3. pwm center-aligned boundary conditions pwdtyx pwperx ppolx output $00 > $00 1 low $00 > $00 0 high pwperx ? 1high pwperx ? 0low ? $00 1 high ? $00 0 low
68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 197 advance information ? 68hc(9)12d60 section 14. enhanced capture timer 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 14.3 enhanced capture timer modes of operation . . . . . . . . . . . . 203 14.4 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 14.5 timer and modulus counter operation in different modes . .235 14.2 introduction the hc12 enhanced capture timer module has the features of the hc12 standard timer module enhanced by additional features in order to enlarge the field of applications, in particular for automotive abs applications. the additional features permit the operation of this timer module in a mode similar to the input control timer implemented on mc68hc11nb4. these additional features are:  16-bit buffer register for four input capture (ic) channels.  four 8-bit pulse accumulators with 8-bit buffer registers associated with the four buffered ic channels. configurable also as two 16-bit pulse accumulators.  16-bit modulus down-counter with 4-bit prescaler.  four user selectable delay counters for input noise immunity increase.  main timer prescaler extended to 7-bit.
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 198 enhanced capture timer motorola this design specification describes the standard timer as well as the additional features. the basic timer consists of a 16-bit, software-programmable counter driven by a prescaler. this timer can be used for many purposes, including input waveform measurements while simultaneously generating an output waveform. pulse widths can vary from microseconds to many seconds. a full access for the counter registers or the input capture/output compare registers should take place in one clock cycle. accessing high byte and low byte separately for all of these registers may not yield the same result as accessing them in one word.
enhanced capture timer introduction 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 199 figure 14-1. timer block diagram in latch mode 16 bit main timer pt1 comparator tc0h hold register pt0 pt3 pt2 pt4 pt5 pt6 pt7 edg0 edg1 edg2 edg3 mux prescaler m clock 16-bit load register 16-bit modulus 0 reset edg0 edg1 edg2 edg4 edg5 edg3 edg6 edg7 1, 2, ..., 128 1, 4, 8, 16 16-bit free-running latch underflow main timer prescaler tc0 capture/compare register comparator tc1 capture/compare register comparator tc2 capture/compare register comparator tc3 capture/compare register comparator tc4 capture/compare register comparator tc5 capture/compare register comparator tc6 capture/compare register comparator tc7 capture/compare register pin logic pin logic pin logic pin logic pin logic pin logic pin logic pin logic delay counter delay counter delay counter delay counter m clock tc1h hold register tc2h hold register tc3h hold register mux mux mux pa0h hold register pac0 0 reset pa1h hold register pac1 0 reset pa2h hold register pac2 0 reset pa3h hold register pac3 write $0000 to modulus counter iclat, latq, bufen (force latch) latq (mdc latch enable) down counter
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 200 enhanced capture timer motorola figure 14-2. timer block diagram in queue mode 16 bit main timer pt1 comparator tc0h hold register pt0 pt3 pt2 pt4 pt5 pt6 pt7 edg0 edg1 edg2 edg3 mux prescaler m clock 16-bit load register 16-bit modulus 0 reset edg0 edg1 edg2 edg4 edg5 edg3 edg6 edg7 1, 2, ..., 128 1, 4, 8, 16 16-bit free-running latch0 main timer prescaler tc0 capture/compare register comparator tc1 capture/compare register comparator tc2 capture/compare register comparator tc3 capture/compare register comparator tc4 capture/compare register comparator tc5 capture/compare register comparator tc6 capture/compare register comparator tc7 capture/compare register pin logic pin logic pin logic pin logic pin logic pin logic pin logic pin logic delay counter delay counter delay counter delay counter m clock tc1h hold register tc2h hold register tc3h hold register mux mux mux pa0h hold register pac0 0 reset pa1h hold register pac1 0 reset pa2h hold register pac2 0 reset pa3h hold register pac3 latch1 latch3 latch2 latq , bufen (queue mode) read tc3h hold register read tc2h hold register read tc1h hold register read tc0h hold register down counter
enhanced capture timer introduction 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 201 figure 14-3. 8-bit pulse accumulators block diagram host cpu data bus pt0 load holding register and reset pulse accumulator 0 0 edg3 edg2 edg1 edg0 edge detector delay counter interrupt interrupt pt1 edge detector delay counter pt2 edge detector delay counter pt3 edge detector delay counter 8-bit pac0 (pacn0) pa0h holding register 0 8-bit pac1 (pacn1) pa1h holding register 0 8-bit pac2 (pacn2) pa2h holding register 0 8-bit pac3 (pacn3) pa3h holding register
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 202 enhanced capture timer motorola figure 14-4. 16-bit pulse accumulators block diagram edge detector 8-bit pac2 intermodule bus 8-bit pac3 pt7 pt0 m clock divide by 64 clock select clk0 clk1 4:1 mux timclk paclk paclk / 256 paclk / 65536 prescaled clock from timer (timer clock) interrupt mux (pamod) edge detector paca delay counter (pacn3) (pacn2) 8-bit pac0 8-bit pac1 interrupt pacb (pacn1) (pacn0)
enhanced capture timer enhanced capture timer modes of operation 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 203 figure 14-5. block diagram for port7 with output compare / pulse accumulator a figure 14-6. c3f-c0f interrupt flag setting 14.3 enhanced capture timer modes of operation the enhanced capture timer has 8 input capture, output compare (ic/oc) channels same as on the hc12 standard timer (timer channels tc0 to tc7). when channels are selected as input capture by selecting pulse accumulator a pad (om7=1 or ol7=1) or (oc7m7 = 1) oc7 ptn edge detector delay counter 16-bit main timer tcn input capture reg. tcnh i.c. holding reg. bufen ? latq ? tfmod set cnf interrupt
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 204 enhanced capture timer motorola the iosx bit in tios register, they are called input capture (ic) channels. four ic channels are the same as on the standard timer with one capture register which memorizes the timer value captured by an action on the associated input pin. four other ic channels, in addition to the capture register, have also one buffer called holding register. this permits to memorize two different timer values without generation of any interrupt. four 8-bit pulse accumulators are associated with the four buffered ic channels. each pulse accumulator has a holding register to memorize their value by an action on its external input. each pair of pulse accumulators can be used as a 16-bit pulse accumulator. the 16-bit modulus down-counter can control the transfer of the ic registers contents and the pulse accumulators to the respective holding registers for a given period, every time the count reaches zero. the modulus down-counter can also be used as a stand-alone time base with periodic interrupt capability. 14.3.1 ic channels the ic channels are composed of four standard ic registers and four buffered ic channels. an ic register is empty when it has been read or latched into the holding register. a holding register is empty when it has been read. 14.3.1.1 non-buffered ic channels the main timer value is memorized in the ic register by a valid input pin transition. if the corresponding novwx bit of the icovw register is cleared, with a new occurrence of a capture, the contents of ic register are overwritten by the new value.
enhanced capture timer enhanced capture timer modes of operation 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 205 if the corresponding novwx bit of the icovw register is set, the capture register cannot be written unless it is empty. this will prevent the captured value to be overwritten until it is read. 14.3.1.2 buffered ic channels there are two modes of operations for the buffered ic channels.  ic latch mode: when enabled (latq=1), the main timer value is memorized in the ic register by a valid input pin transition. the value of the buffered ic register is latched to its holding register by the modulus counter for a given period when the count reaches zero, by a write $0000 to the modulus counter or by a write to iclat in the mcctl register. if the corresponding novwx bit of the icovw register is cleared, with a new occurrence of a capture, the contents of ic register are overwritten by the new value. in case of latching, the contents of its holding register are overwritten. if the corresponding novwx bit of the icovw register is set, the capture register or its holding register cannot be written by an event unless they are empty (see ic channels ). this will prevent the captured value to be overwritten until it is read or latched in the holding register.  ic queue mode: when enabled (latq=0), the main timer value is memorized in the ic register by a valid input pin transition. if the corresponding novwx bit of the icovw register is cleared, with a new occurrence of a capture, the value of the ic register will be transferred to its holding register and the ic register memorizes the new timer value. if the corresponding novwx bit of the icovw register is set, the capture register or its holding register cannot be written by an event unless they are empty (see ic channels ).
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 206 enhanced capture timer motorola in queue mode, reads of holding register will latch the corresponding pulse accumulator value to its holding register. 14.3.2 pulse accumulators there are four 8-bit pulse accumulators with four 8-bit holding registers associated with the four ic buffered channels. a pulse accumulator counts the number of active edges at the input of its channel. the user can prevent 8-bit pulse accumulators counting further than $ff by pacmx control bit in icsys ($ab). in this case a value of $ff means that 255 counts or more have occurred. each pair of pulse accumulators can be used as a 16-bit pulse accumulator. there are two modes of operation for the pulse accumulators. 14.3.2.1 pulse accumulator latch mode the value of the pulse accumulator is transferred to its holding register when the modulus down-counter reaches zero, a write $0000 to the modulus counter or when the force latch control bit iclat is written. at the same time the pulse accumulator is cleared. 14.3.2.2 pulse accumulator queue mode when queue mode is enabled, reads of an input capture holding register will transfer the contents of the associated pulse accumulator to its holding register. at the same time the pulse accumulator is cleared. 14.3.3 modulus down-counter the modulus down-counter can be used as a time base to generate a periodic interrupt. it can also be used to latch the values of the ic registers and the pulse accumulators to their holding registers.
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 207 the action of latching can be programmed to be periodic or only once. 14.4 timer registers input/output pins default to general-purpose i/o lines until an internal function which uses that pin is specifically enabled. the timer overrides the state of the ddr to force the i/o state of each associated port line when an output compare using a port line is enabled. in these cases the data direction bits will have no affect on these lines. when a pin is assigned to output an on-chip peripheral function, writing to this portt bit does not affect the pin but the data is stored in an internal latch such that if the pin becomes available for general-purpose output the driven level will be the last value written to the portt bit. read or write anytime. ios[7:0] ? input capture or output compare channel configuration 0 = the corresponding channel acts as an input capture 1 = the corresponding channel acts as an output compare. bit 7654321bit 0 ios7 ios6 ios5 ios4 ios3 ios2 ios1 ios0 reset: 0 0 000000 tios ? timer input capture/output compare select $0080
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 208 enhanced capture timer motorola read anytime but will always return $00 (1 state is transient). write anytime. foc[7:0] ? force output compare action for channel 7-0 a write to this register with the corresponding data bit(s) set causes the action which is programmed for output compare ? n ? to occur immediately. the action taken is the same as if a successful comparison had just taken place with the tcn register except the interrupt flag does not get set. read or write anytime. the bits of oc7m correspond bit-for-bit with the bits of timer port (portt). setting the oc7mn will set the corresponding port to be an output port regardless of the state of the ddrtn bit when the corresponding iosn bit is set to be an output compare. this does not change the state of the ddrt bits. at successful oc7, for each bit that is set in oc7m, the corresponding data bit oc7d is stored to the corresponding bit of the timer port. note: oc7m has priority over output action on the timer port enabled by omn and oln bits in tctl1 and tctl2. if an oc7m bit is set, it prevents the action of corresponding om and ol bits on the selected timer port. bit 7654321bit 0 foc7 foc6 foc5 foc4 foc3 foc2 foc1 foc0 reset: 0 0 000000 cforc ? timer compare force register $0081 bit 7654321bit 0 oc7m7 oc7m6 oc7m5 oc7m4 oc7m3 oc7m2 oc7m1 oc7m0 reset: 0 0 000000 oc7m ? output compare 7 mask register $0082
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 209 read or write anytime. the bits of oc7d correspond bit-for-bit with the bits of timer port (portt). when a successful oc7 compare occurs, for each bit that is set in oc7m, the corresponding data bit in oc7d is stored to the corresponding bit of the timer port. when the oc7mn bit is set, a successful oc7 action will override a successful oc[6:0] compare action during the same cycle; therefore, the ocn action taken will depend on the corresponding oc7d bit. the 16-bit main timer is an up counter. a full access for the counter register should take place in one clock cycle. a separate read/write for high byte and low byte will give a different result than accessing them as a word. read anytime. write has no meaning or effect in the normal mode; only writable in special modes (smodn = 0). bit 7654321bit 0 oc7d7 oc7d6 oc7d5 oc7d4 oc7d3 oc7d2 oc7d1 oc7d0 reset: 0 0 000000 oc7d ? output compare 7 data register $0083 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 reset: 0 0 000000 tcnt ? timer count register $0084 ? $0085
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 210 enhanced capture timer motorola the period of the first count after a write to the tcnt registers may be a different size because the write is not synchronized with the prescaler clock. read or write anytime. ten ? timer enable 0 = disables the main timer, including the counter. can be used for reducing power consumption. 1 = allows the timer to function normally. if for any reason the timer is not active, there is no 64 clock for the pulse accumulator since the e 64 is generated by the timer prescaler. tswai ? timer module stops while in wait 0 = allows the timer module to continue running during wait. 1 = disables the timer module when the mcu is in the wait mode. timer interrupts cannot be used to get the mcu out of wait. tswai also affects pulse accumulators and modulus down counters. tsbck ? timer and modulus counter stop while in background mode 0 = allows the timer and modulus counter to continue running while in background mode. 1 = disables the timer and modulus counter whenever the mcu is in background mode. this is useful for emulation. tbsck does not stop the pulse accumulator. tffca ? timer fast flag clear all 0 = allows the timer flag clearing to function normally. 1 = for tflg1($8e), a read from an input capture or a write to the output compare channel ($90 ? $9f) causes the corresponding channel flag, cnf, to be cleared. for tflg2 ($8f), any access to the tcnt register ($84, $85) clears the tof flag. any access to the pacn3 and pacn2 registers ($a2, $a3) clears bit 7654321bit 0 ten tswai tsbck tffca reset: 0 0 0 0 0 0 0 0 tscr ? timer system control register $0086
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 211 the paovf and paif flags in the paflg register ($a1). any access to the pacn1 and pacn0 registers ($a4, $a5) clears the pbovf flag in the pbflg register ($b1). any access to the mccnt register ($b6, $b7) clears the mczf flag in the mcflg register ($a7). this has the advantage of eliminating software overhead in a separate clear sequence. extra care is required to avoid accidental flag clearing due to unintended accesses. read or write anytime. omn ? output mode oln ? output level these eight pairs of control bits are encoded to specify the output action to be taken as a result of a successful ocn compare. when either omn or oln is one, the pin associated with ocn becomes an output tied to ocn regardless of the state of the associated ddrt bit. note: to enable output action by omn and oln bits on the timer port, the corresponding bit in oc7m should be cleared. bit 7654321bit 0 reset: 00000000 tqcr ? reserved $0087 bit 76 5 4 3 2 1bit 0 om7ol7om6ol6om5ol5om4ol4 reset: 0 0 0 0 0 0 0 0 tctl1 ? timer control register 1 $0088 bit 7654321bit 0 om3 ol3 om2 ol2 om1 ol1 om0 ol0 reset: 00000000 tctl2 ? timer control register 2 $0089
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 212 enhanced capture timer motorola to operate the 16-bit pulse accumulators a and b (paca and pacb) independently of input capture or output compare 7 and 0 respectively the user must set the corresponding bits iosn = 1, omn = 0 and oln = 0. oc7m7 or oc7m0 in the oc7m register must also be cleared. read or write anytime. edgnb, edgna ? input capture edge control these eight pairs of control bits configure the input capture edge detector circuits. table 14-1. compare result output action omn oln action 0 0 timer disconnected from output pin logic 0 1 toggle ocn output line 1 0 clear ocn output line to zero 1 1 set ocn output line to one bit 7654321bit 0 edg7b edg7a edg6b edg6a edg5b edg5a edg4b edg4a reset: 0 0 000000 tctl3 ? timer control register 3 $008a bit 76 5 4 3 2 1bit 0 edg3b edg3a edg2b edg2a edg1b edg1a edg0b edg0a reset: 0 0 0 0 0 0 0 0 tctl4 ? timer control register 4 $008b table 14-2. edge detector circuit configuration edgnb edgna configuration 0 0 capture disabled 0 1 capture on rising edges only 1 0 capture on falling edges only 1 1 capture on any edge (rising or falling)
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 213 read or write anytime. the bits in tmsk1 correspond bit-for-bit with the bits in the tflg1 status register. if cleared, the corresponding flag is disabled from causing a hardware interrupt. if set, the corresponding flag is enabled to cause a hardware interrupt. read or write anytime. c7i ? c0i ? input capture/output compare ? x ? interrupt enable. read or write anytime. toi ? timer overflow interrupt enable 0 = interrupt inhibited 1 = hardware interrupt requested when tof flag set pupt ? timer port pull-up resistor enable this enable bit controls pull-up resistors on the timer port pins when the pins are configured as inputs. 0 = disable pull-up resistor function 1 = enable pull-up resistor function bit 7654321bit 0 c7i c6i c5i c4i c3i c2i c1i c0i reset: 0 0 000000 tmsk1 ? timer interrupt mask 1 $008c bit 7654321bit 0 toi 0 pupt rdpt tcre pr2 pr1 pr0 reset:00000000 tmsk2 ? timer interrupt mask 2 $008d
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 214 enhanced capture timer motorola rdpt ? timer port drive reduction this bit reduces the effective output driver size which can reduce power supply current and generated noise depending upon pin loading. 0 = normal output drive capability 1 = enable output drive reduction function tcre ? timer counter reset enable this bit allows the timer counter to be reset by a successful output compare 7 event. this mode of operation is similar to an up-counting modulus counter. 0 = counter reset inhibited and counter free runs 1 = counter reset by a successful output compare 7 if tc7 = $0000 and tcre = 1, tcnt will stay at $0000 continuously. if tc7 = $ffff and tcre = 1, tof will never be set when tcnt is reset from $ffff to $0000. pr2, pr1, pr0 ? timer prescaler select these three bits specify the number of 2 stages that are to be inserted between the module clock and the main timer counter. the newly selected prescale factor will not take effect until the next synchronized edge where all prescale counter stages equal zero. table 14-3. prescaler selection pr2 pr1 pr0 prescale factor 000 1 001 2 010 4 011 8 100 16 101 32 110 64 111 128
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 215 tflg1 indicates when interrupt conditions have occurred. to clear a bit in the flag register, write a one to the bit. use of the tfmod bit in the icsys register ($ab) in conjunction with the use of the icovw register ($aa) allows a timer interrupt to be generated after capturing two values in the capture and holding registers instead of generating an interrupt for every capture. read anytime. write used in the clearing mechanism (set bits cause corresponding bits to be cleared). writing a zero will not affect current status of the bit. when tffca bit in tscr register is set, a read from an input capture or a write into an output compare channel ($90 ? $9f) will cause the corresponding channel flag cnf to be cleared. c7f ? c0f ? input capture/output compare channel ? n ? flag. tflg2 indicates when interrupt conditions have occurred. to clear a bit in the flag register, set the bit to one. read anytime. write used in clearing mechanism (set bits cause corresponding bits to be cleared). any access to tcnt will clear tflg2 register if the tffca bit in tscr register is set. bit 7654321bit 0 c7f c6f c5f c4f c3f c2f c1f c0f reset: 0 0 0 0 0 0 0 0 tflg1 ? main timer interrupt flag 1 $008e bit 7654321bit 0 tof0000000 reset: 0 0 0 0 0 0 0 0 tflg2 ? main timer interrupt flag 2 $008f
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 216 enhanced capture timer motorola tof ? timer overflow flag set when 16-bit free-running timer overflows from $ffff to $0000. this bit is cleared automatically by a write to the tflg2 register with bit 7 set. (see also tcre control bit explanation.) bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc0 ? timer input capture/output compare register 0 $0090 ? $0091 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc1 ? timer input capture/output compare register 1 $0092 ? $0093 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc2 ? timer input capture/output compare register 2 $0094 ? $0095 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc3 ? timer input capture/output compare register 3 $0096 ? $0097 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc4 ? timer input capture/output compare register 4 $0098 ? $0099 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc5 ? timer input capture/output compare register 5 $009a ? $009b
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 217 depending on the tios bit for the corresponding channel, these registers are used to latch the value of the free-running counter when a defined transition is sensed by the corresponding input capture edge detector or to trigger an output action for output compare. read anytime. write anytime for output compare function. writes to these registers have no meaning or effect during input capture. all timer input capture/output compare registers are reset to $0000. 16-bit pulse accumulator a (paca) is formed by cascading the 8-bit pulse accumulators pac3 and pac2. when paen is set, the paca is enabled. the paca shares the input pin with ic7. read: any time write: any time bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc6 ? timer input capture/output compare register 6 $009c ? $009d bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc7 ? timer input capture/output compare register 7 $009e ? $009f bit 7654321bit 0 0 paen pamod pedge clk1 clk0 paovi pai reset: 00000000 pactl ? 16-bit pulse accumulator a control register $00a0
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 218 enhanced capture timer motorola paen ? pulse accumulator a system enable 0 = 16-bit pulse accumulator a system disabled. 8-bit pac3 and pac2 can be enabled when their related enable bits in icpacr ($a8) are set. pulse accumulator input edge flag (paif) function is disabled. 1 = pulse accumulator a system enabled. the two 8-bit pulse accumulators pac3 and pac2 are cascaded to form the paca 16-bit pulse accumulator. when paca in enabled, the pacn3 and pacn2 registers contents are respectively the high and low byte of the paca. pa3en and pa2en control bits in icpacr ($a8) have no effect. pulse accumulator input edge flag (paif) function is enabled. paen is independent from ten. with timer disabled, the pulse accumulator can still function unless pulse accumulator is disabled. pamod ? pulse accumulator mode 0 = event counter mode 1 = gated time accumulation mode pedge ? pulse accumulator edge control for pamod bit = 0 (event counter mode). 0 = falling edges on pt7 pin cause the count to be incremented 1 = rising edges on pt7 pin cause the count to be incremented for pamod bit = 1 (gated time accumulation mode). 0 = pt7 input pin high enables m divided by 64 clock to pulse accumulator and the trailing falling edge on pt7 sets the paif flag. 1 = pt7 input pin low enables m divided by 64 clock to pulse accumulator and the trailing rising edge on pt7 sets the paif flag. pamod pedge pin action 0 0 falling edge 0 1 rising edge 1 0 div. by 64 clock enabled with pin high level 1 1 div. by 64 clock enabled with pin low level
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 219 if the timer is not active (ten = 0 in tscr), there is no divide-by-64 since the e 64 clock is generated by the timer prescaler. clk1, clk0 ? clock select bits if the pulse accumulator is disabled (paen = 0), the prescaler clock from the timer is always used as an input clock to the timer counter. the change from one selected clock to the other happens immediately after these bits are written. paovi ? pulse accumulator a overflow interrupt enable 0 = interrupt inhibited 1 = interrupt requested if paovf is set pai ? pulse accumulator input interrupt enable 0 = interrupt inhibited 1 = interrupt requested if paif is set read or write anytime. when the tffca bit in the tscr register is set, any access to the pacnt register will clear all the flags in the paflg register. paovf ? pulse accumulator a overflow flag set when the 16-bit pulse accumulator a overflows from $ffff to $0000, or when 8-bit pulse accumulator 3 (pac3) overflows from $ff to $00. clk1 clk0 clock source 0 0 use timer prescaler clock as timer counter clock 0 1 use paclk as input to timer counter clock 1 0 use paclk/256 as timer counter clock frequency 11 use paclk/65536 as timer counter clock frequency bit 7654321bit 0 0 0 0 0 0 0 paovf paif reset: 0 0 0 0 0 0 0 0 paflg ? pulse accumulator a flag register $00a1
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 220 enhanced capture timer motorola this bit is cleared automatically by a write to the paflg register with bit 1 set. paif ? pulse accumulator input edge flag set when the selected edge is detected at the pt7 input pin. in event mode the event edge triggers paif and in gated time accumulation mode the trailing edge of the gate signal at the pt7 input pin triggers paif. this bit is cleared by a write to the paflg register with bit 0 set. any access to the pacn3, pacn2 registers will clear all the flags in this register when tffca bit in register tscr($86) is set. read: any time write: any time the two 8-bit pulse accumulators pac3 and pac2 are cascaded to form the paca 16-bit pulse accumulator. when paca in enabled (paen=1 in pactl, $a0) the pacn3 and pacn2 registers contents are respectively the high and low byte of the paca. when pacn3 overflows from $ff to $00, the interrupt flag paovf in paflg ($a1) is set. full count register access should take place in one clock cycle. a separate read/write for high byte and low byte will give a different result than accessing them as a word. bit 7654321bit 0 $00a2bit 7654321bit 0pacn3 (hi) $00a3bit 7654321bit 0pacn2 (lo) reset: 00000000 pacn3, pacn2 ? pulse accumulators count registers $00a2, $00a3
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 221 read: any time write: any time the two 8-bit pulse accumulators pac1 and pac0 are cascaded to form the pacb 16-bit pulse accumulator. when pacb in enabled, (pben=1 in pbctl, $b0) the pacn1 and pacn0 registers contents are respectively the high and low byte of the pacb. when pacn1 overflows from $ff to $00, the interrupt flag pbovf in pbflg ($b1) is set. full count register access should take place in one clock cycle. a separate read/write for high byte and low byte will give a different result than accessing them as a word. read: any time write: any time mczi ? modulus counter underflow interrupt enable 0 = modulus counter interrupt is disabled. 1 = modulus counter interrupt is enabled. bit 7654321bit 0 $00a4bit 7654321bit 0pacn1 (hi) $00a5bit 7654321bit 0pacn0 (lo) reset: 0 0 0 0 0 0 0 0 pacn1, pacn0 ? pulse accumulators count registers $00a4, $00a5 bit 7654321bit 0 mczi modmc rdmcl iclat flmc mcen mcpr1 mcpr0 reset: 0 0 0 0 0 0 0 0 mcctl ? 16-bit modulus down-counter control register $00a6
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 222 enhanced capture timer motorola modmc ? modulus mode enable 0 = the counter counts once from the value written to it and will stop at $0000. 1 = modulus mode is enabled. when the counter reaches $0000, the counter is loaded with the latest value written to the modulus count register. note: for proper operation, the mcen bit should be cleared before modifying the modmc bit in order to reset the modulus counter to $ff. rdmcl ? read modulus down-counter load 0 = reads of the modulus count register will return the present value of the count register. 1 = reads of the modulus count register will return the contents of the load register. iclat ? input capture force latch action when input capture latch mode is enabled (latq and bufen bit in icsys ($ab) are set), a write one to this bit immediately forces the contents of the input capture registers tc0 to tc3 and their corresponding 8-bit pulse accumulators to be latched into the associated holding registers. the pulse accumulators will be automatically cleared when the latch action occurs. writing zero to this bit has no effect. read of this bit will return always zero. flmc ? force load register into the modulus counter count register this bit is active only when the modulus down-counter is enabled (mcen=1). a write one into this bit loads the load register into the modulus counter count register. this also resets the modulus counter prescaler. write zero to this bit has no effect. when modmc=0, counter starts counting and stops at $0000. read of this bit will return always zero.
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 223 mcen ? modulus down-counter enable 0 = modulus counter disabled. 1 = modulus counter is enabled. when mcen=0, the counter is preset to $ffff. this will prevent an early interrupt flag when the modulus down-counter is enabled. mcpr1, mcpr0 ? modulus counter prescaler select these two bits specify the division rate of the modulus counter prescaler. the newly selected prescaler division rate will not be effective until a load of the load register into the modulus counter count register occurs. read: any time write: only for clearing bit 7 mczf ? modulus counter underflow interrupt flag the flag is set when the modulus down-counter reaches $0000. writing a1 to this bit clears the flag (if tffca=0). writing zero has no effect. any access to the mccnt register will clear the mczf flag in this register when tffca bit in register tscr($86) is set. mcpr1 mcpr0 prescaler division rate 00 1 01 4 10 8 11 16 bit 7654321bit 0 mczf 0 0 0 polf3 polf2 polf1 polf0 reset: 0 0 000000 mcflg ? 16-bit modulus down-counter flag register $00a7
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 224 enhanced capture timer motorola polf3 ? polf0 ? first input capture polarity status these are read only bits. write to these bits has no effect. each status bit gives the polarity of the first edge which has caused an input capture to occur after capture latch has been read. each polfx corresponds to a timer portx input. 0 = the first input capture has been caused by a falling edge. 1 = the first input capture has been caused by a rising edge. the 8-bit pulse accumulators pac3 and pac2 can be enabled only if paen in patcl ($a0) is cleared. if paen is set, pa3en and pa2en have no effect. the 8-bit pulse accumulators pac1 and pac0 can be enabled only if pben in pbtcl ($b0) is cleared. if pben is set, pa1en and pa0en have no effect. read: any time write: any time paxen ? 8-bit pulse accumulator ? x ? enable 0 = 8-bit pulse accumulator is disabled. 1 = 8-bit pulse accumulator is enabled. bit 7654321bit 0 0 0 0 0 pa3en pa2en pa1en pa0en reset: 0 0 0 0 0 0 0 0 icpacr ? input control pulse accumulators control register $00a8
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 225 read: any time write: any time if enabled, after detection of a valid edge on input capture pin, the delay counter counts the pre-selected number of m clock (module clock) cycles, then it will generate a pulse on its output. the pulse is generated only if the level of input signal, after the preset delay, is the opposite of the level before the transition.this will avoid reaction to narrow input pulses. after counting, the counter will be cleared automatically. delay between two active edges of the input signal period should be longer than the selected counter delay. dlyx ? delay counter select read: any time write: any time bit 7654321bit 0 000000dly1dly0 reset: 0 0 000000 dlyct ? delay counter control register $00a9 dly1 dly0 delay 0 0 disabled (bypassed) 0 1 256 m clock cycles 1 0 512 m clock cycles 1 1 1024 m clock cycles bit 7654321bit 0 novw7 novw6 novw5 novw4 novw3 novw2 novw1 novw0 reset: 0 0 000000 icovw ? input control overwrite register $00aa
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 226 enhanced capture timer motorola an ic register is empty when it has been read or latched into the holding register. a holding register is empty when it has been read. novwx ? no input capture overwrite 0 = the contents of the related capture register or holding register can be overwritten when a new input capture or latch occurs. 1 = the related capture register or holding register cannot be written by an event unless they are empty (see ic channels ). this will prevent the captured value to be overwritten until it is read or latched in the holding register. read: any time write: may be written once (smodn=1). writes are always permitted when smodn=0. shxy ? share input action of input capture channels x and y 0 = normal operation 1 = the channel input ? x ? causes the same action on the channel ? y ? . the port pin ? x ? and the corresponding edge detector is used to be active on the channel ? y ? . tfmod ? timer flag-setting mode use of the tfmod bit in the icsys register ($ab) in conjunction with the use of the icovw register ($aa) allows a timer interrupt to be generated after capturing two values in the capture and holding registers instead of generating an interrupt for every capture. by setting tfmod in queue mode, when novw bit is set and the corresponding capture and holding registers are emptied, an input capture event will first update the related input capture register with bit 7654321bit 0 sh37 sh26 sh15 sh04 tfmod pacmx bufen latq reset: 0 0 000000 icsys ? input control system control register $00ab
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 227 the main timer contents. at the next event the tcn data is transferred to the tcnh register, the tcn is updated and the cnf interrupt flag is set. see figure 14-6 . in all other input capture cases the interrupt flag is set by a valid external event on ptn. 0 = the timer flags c3f ? c0f in tflg1 ($8e) are set when a valid input capture transition on the corresponding port pin occurs. 1 = if in queue mode (bufen=1 and latq=0), the timer flags c3f ? c0f in tflg1 ($8e) are set only when a latch on the corresponding holding register occurs. if the queue mode is not engaged, the timer flags c3f ? c0f are set the same way as for tfmod=0. pacmx ? 8-bit pulse accumulators maximum count 0 = normal operation. when the 8-bit pulse accumulator has reached the value $ff, with the next active edge, it will be incremented to $00. 1 = when the 8-bit pulse accumulator has reached the value $ff, it will not be incremented further. the value $ff indicates a count of 255 or more. bufen ? ic buffer enable 0 = input capture and pulse accumulator holding registers are disabled. 1 = input capture and pulse accumulator holding registers are enabled. the latching mode is defined by latq control bit. write one into iclat bit in mcctl ($a6), when latq is set will produce latching of input capture and pulse accumulators registers into their holding registers. latq ? input control latch or queue mode enable the bufen control bit should be set in order to enable the ic and pulse accumulators holding registers. otherwise latq latching modes are disabled. write one into iclat bit in mcctl ($a6), when latq and bufen are set will produce latching of input capture and pulse accumulators registers into their holding registers.
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 228 enhanced capture timer motorola 0 = queue mode of input capture is enabled. the main timer value is memorized in the ic register by a valid input pin transition. with a new occurrence of a capture, the value of the ic register will be transferred to its holding register and the ic register memorizes the new timer value. 1 = latch mode is enabled. latching function occurs when modulus down-counter reaches zero or a zero is written into the count register mccnt (see buffered ic channels ). with a latching event the contents of ic registers and 8-bit pulse accumulators are transferred to their holding registers. 8-bit pulse accumulators are cleared. read: any time write: only in special mode (smod = 1). tcbyp ? main timer divider chain bypass 0 = normal operation 1 = for testing only. the 16-bit free-running timer counter is divided into two 8-bit halves and the prescaler is bypassed. the clock drives both halves directly. when the high byte of timer counter tcnt ($84) overflows from $ff to $00, the tof flag in tflg2 ($8f) will be set. bit 7654321bit 0 000000tcbyp0 reset: 0 0 000000 timtst ? timer test register $00ad
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 229 read: any time (inputs return pin level; outputs return data register contents) write: data stored in an internal latch (drives pins only if configured for output) since the output compare 7 shares the pin with pulse accumulator input, the only way for pulse accumulator to receive an independent input from output compare 7 is setting both om7 & ol7 to be zero, and also oc7m7 in oc7m register to be zero. oc7 is still able to reset the counter if enabled while pt7 is used as input to pulse accumulator. portt can be read anytime. when configured as an input, a read will return the pin level. when configured as an output, a read will return the latched output data. note: writes do not change pin state when the pin is configured for timer output. the minimum pulse width for pulse accumulator input should always be greater than the width of two module clocks due to input synchronizer circuitry. the minimum pulse width for the input capture should always be greater than the width of two module clocks due to input synchronizer circuitry. bit 7654321bit 0 port pt7 pt6 pt5 pt4 pt3 pt2 pt1 pt0 timer i/oc7 i/oc6 i/oc5 i/oc4 i/oc3 i/oc2 i/oc1 i/oc0 reset: 0 0 000000 portt ? timer port data register $00ae
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 230 enhanced capture timer motorola read or write any time. 0 = configures the corresponding i/o pin for input only 1 = configures the corresponding i/o pin for output. the timer forces the i/o state to be an output for each timer port line associated with an enabled output compare. in these cases the data direction bits will not be changed, but have no effect on the direction of these pins. the ddrt will revert to controlling the i/o direction of a pin when the associated timer output compare is disabled. input captures do not override the ddrt settings. read: any time write: any time 16-bit pulse accumulator b (pacb) is formed by cascading the 8-bit pulse accumulators pac1 and pac0. when pben is set, the pacb is enabled. the pacb shares the input pin with ic0. pben ? pulse accumulator b system enable 0 = 16-bit pulse accumulator system disabled. 8-bit pac1 and pac0 can be enabled when their related enable bits in icpacr ($a8) are set. bit 7654321bit 0 ddt7 ddt6 ddt5 ddt4 ddt3 ddt2 ddt1 ddt0 reset: 00000000 ddrt ? data direction register for timer port $00af bit 7654321bit 0 0 pben 0 0 0 0 pbovi 0 reset: 0 0 0 0 0 0 0 0 pbctl ? 16-bit pulse accumulator b control register $00b0
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 231 1 = pulse accumulator b system enabled. the two 8-bit pulse accumulators pac1 and pac0 are cascaded to form the pacb 16-bit pulse accumulator. when pacb in enabled, the pacn1 and pacn0 registers contents are respectively the high and low byte of the pacb. pa1en and pa0en control bits in icpacr ($a8) have no effect. pben is independent from ten. with timer disabled, the pulse accumulator can still function unless pulse accumulator is disabled. pbovi ? pulse accumulator b overflow interrupt enable 0 = interrupt inhibited 1 = interrupt requested if pbovf is set read: any time write: any time pbovf ? pulse accumulator b overflow flag this bit is set when the 16-bit pulse accumulator b overflows from $ffff to $0000, or when 8-bit pulse accumulator 1 (pac1) overflows from $ff to $00. this bit is cleared by a write to the pbflg register with bit 1 set. any access to the pacn1 and pacn0 registers will clear the pbovf flag in this register when tffca bit in register tscr($86) is set. bit 7654321bit 0 000000pbovf0 reset:00000000 pbflg ? pulse accumulator b flag register $00b1
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 232 enhanced capture timer motorola read: any time write: has no effect. these registers are used to latch the value of the corresponding pulse accumulator when the related bits in register icpacr ($a8) are enabled (see pulse accumulators ). read: any time write: any time a full access for the counter register should take place in one clock cycle. a separate read/write for high byte and low byte will give different result than accessing them as a word. if the rdmcl bit in mcctl register is cleared, reads of the mccnt register will return the present value of the count register. if the rdmcl bit is set, reads of the mccnt will return the contents of the load register. bit 7654321bit 0 $00b2bit 7654321bit 0pa3h $00b3bit 7654321bit 0pa2h $00b4bit 7654321bit 0pa1h $00b5bit 7654321bit 0pa0h reset:00000000 pa3h ? pa0h ? 8-bit pulse accumulators holding registers $00b2 ? $00b5 bit 7654321bit 0 $00b6 bit 15 14 13 12 11 10 9 bit 8 mccnth $00b7bit 7654321bit 0m ccntl reset: 1 1111111 mccnth/l ? modulus down-counter count register $00b6, $00b7
enhanced capture timer timer registers 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 233 if a $0000 is written into mccnt and modulus counter while latq and bufen in icsys ($ab) register are set, the input capture and pulse accumulator registers will be latched. with a $0000 write to the mccnt, the modulus counter will stay at zero and does not set the mczf flag in mcflg register. if modulus mode is enabled (modmc=1), a write to this address will update the load register with the value written to it. the count register will not be updated with the new value until the next counter underflow. the flmc bit in mcctl ($a6) can be used to immediately update the count register with the new value if an immediate load is desired. if modulus mode is not enabled (modmc=0), a write to this address will clear the prescaler and will immediately update the counter register with the value written to it and down-counts once to $0000.
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 234 enhanced capture timer motorola read: any time write: has no effect. these registers are used to latch the value of the input capture registers tc0 ? tc3. the corresponding iosx bits in tios ($80) should be cleared (see ic channels ). bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc0h ? timer input capture holding register 0 $00b8 ? $00b9 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc1h ? timer input capture holding register 1 $00ba ? $00bb bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc2h ? timer input capture holding register 2 $00bc ? $00bd bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 bit 7654321bit 0 tc3h ? timer input capture holding register 3 $00be ? $00bf
enhanced capture timer timer and modulus counter operation in different modes 68hc(9)12d60 ? rev 3.0 advance information motorola enhanced capture timer 235 14.5 timer and modulus counter operation in different modes stop: timer and modulus counter are off since clocks are stopped. bgdm: timer and modulus counter keep on running, unless tsbck (reg$86, bit5) is set to one. wait: counters keep on running, unless tswai in tscr ($86) is set to one. normal: timer and modulus counter keep on running, unless ten in tscr($86) respectively mcen in mcctl ($a6) are cleared. ten=0: all 16-bit timer operations are stopped, can only access the registers. mcen=0: modulus counter is stopped. paen=1: 16-bit pulse accumulator a is active. paen=0: 8-bit pulse accumulators 3 and 2 can be enabled. (see icpacr) pben=1: 16-bit pulse accumulator b is active. pben=0: 8-bit pulse accumulators 1 and 0 can be enabled. (see icpacr)
enhanced capture timer advance information 68hc(9)12d60 ? rev 3.0 236 enhanced capture timer motorola
68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 237 advance information ? 68hc(9)12d60 section 15. multiple serial interface 15.1 contents 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 15.3 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 15.4 serial communication interface (sci) . . . . . . . . . . . . . . . . . . 238 15.5 serial peripheral interface (spi) . . . . . . . . . . . . . . . . . . . . . . . 250 15.6 port s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 15.2 introduction the multiple serial interface (msi) module consists of three independent serial i/o sub-systems: two serial communication interfaces (sci0 and sci1) and the serial peripheral interface (spi). each serial pin shares function with the general-purpose port pins of port s. the sci subsystems are nrz type systems that are compatible with standard rs-232 systems. these sci systems have a new single wire operation mode which allows the unused pin to be available as general-purpose i/o. the spi subsystem, which is compatible with the m68hc11 spi, includes new features such as ss output and bidirectional mode.
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 238 multiple serial interface motorola 15.3 block diagram figure 15-1. multiple serial interface block diagram 15.4 serial communication interface (sci) two serial communication interfaces are available on the 68hc(9)12d60. these are nrz format (one start, eight or nine data, and one stop bit) asynchronous communication systems with independent internal baud rate generation circuitry and sci transmitters and receivers. they can be configured for eight or nine data bits (one of which may be designated as a parity bit, odd or even). if enabled, parity is generated in hardware for transmitted and received data. receiver parity errors are flagged in hardware. the baud rate generator is based on a modulus counter, allowing flexibility in choosing baud rates. there is a receiver wake-up feature, an idle line detect feature, a loop-back mode, and various error detection features. two port pins for each sci provide the external interface for the transmitted data (txd) and the received data (rxd). for a faster wake-up out of wait mode by a received sci message, both sci have the capability of sending a receiver interrupt, if enabled, when raf (receiver active flag) is set. for compatibility with other m68hc12 products, this feature is active only in wait mode and is disabled when vddpll supply is at v ss level. ps0 ps1 ps2 ps3 ps4 ps5 ps6 ps7 sci0 sci1 spi ddrs/ioctlr port s i/o drivers msi rxd0 txd0 rxd1 txd1 miso/siso mosi/momi sck cs /ss
multiple serial interface serial communication interface (sci) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 239 figure 15-2. serial communications interface block diagram 15.4.1 data format the serial data format requires the following conditions:  an idle-line in the high state before transmission or reception of a message. rx baud rate tx baud rate mclk divider 10-11 bit shift reg msb txd buffer/scxdrl txmtr control scxcr2/sci ctl 2 scxcr1/sci ctl 1 scxsr1/int status data recovery 10-11 bit shift reg txd buffer/scxdrl scxbd/select lsb rxd txd pin control / ddrs / port s wake-up logic scxcr1/sci ctl 1 scxsr1/int status scxcr2/sci ctl 2 int request logic msb lsb int request logic sci receiver sci transmitter baud rate clock to internal logic data bus parity detect parity generator
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 240 multiple serial interface motorola  a start bit (logic zero), transmitted or received, that indicates the start of each character.  data that is transmitted or received least significant bit (lsb) first.  a stop bit (logic one), used to indicate the end of a frame. (a frame consists of a start bit, a character of eight or nine data bits and a stop bit.)  a break is defined as the transmission or reception of a logic zero for one frame or more.  this sci supports hardware parity for transmit and receive. 15.4.2 sci baud rate generation the basis of the sci baud rate generator is a 13-bit modulus counter. this counter gives the generator the flexibility necessary to achieve a reasonable level of independence from the cpu operating frequency and still be able to produce standard baud rates with a minimal amount of error. the clock source for the generator comes from the m clock. table 15-1. baud rate generation desired sci baud rate br divisor for m = 4.0 mhz br divisor for m = 8.0 mhz 110 2273 4545 300 833 2273 600 417 833 1200 208 417 2400 104 208 4800 52 104 9600 26 52 14400 17 35 19200 13 26 38400 ? 13
multiple serial interface serial communication interface (sci) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 241 15.4.3 sci register descriptions control and data registers for the sci subsystem are described below. the memory address indicated for each register is the default address that is in use after reset. both sci have identical control registers mapped in two blocks of eight bytes. scxbdh and scxbdl are considered together as a 16-bit baud rate control register. read any time. write sbr[12:0] anytime. low order byte must be written for change to take effect. write sbr[15:13] only in special modes. the value in sbr[12:0] determines the baud rate of the sci. the desired baud rate is determined by the following formula: which is equivalent to: br is the value written to bits sbr[12:0] to establish baud rate. note: the baud rate generator is disabled until te or re bit in scxcr2 register is set for the first time after reset, and/or the baud rate generator is disabled when sbr[12:0] = 0. bit 7654321bit 0 btst bspl brld sbr12 sbr11 sbr10 sbr9 sbr8 high reset: 00000000 sc0bdh/sc1bdh ? sci baud rate control register $00c0/$00c8 bit 7654321bit 0 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 low reset:00000100 sc0bdl/sc1bdl ? sci baud rate control register $00c1/$00c9 sci baud rate mclk 16 br ??
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 242 multiple serial interface motorola btst ? reserved for test function bspl ? reserved for test function brld ? reserved for test function read or write anytime. loops ? sci loop mode/single wire mode enable 0 = sci transmit and receive sections operate normally. 1 = sci receive section is disconnected from the rxd pin and the rxd pin is available as general purpose i/o. the receiver input is determined by the rsrc bit. the transmitter output is controlled by the associated ddrs bit. both the transmitter and the receiver must be enabled to use the loop or the single wire mode. if the ddrs bit associated with the txd pin is set during the loops = 1, the txd pin outputs the sci waveform. if the ddrs bit associated with the txd pin is clear during the loops = 1, the txd pin becomes high (idle line state) for rsrc = 0 and high impedance for rsrc = 1. refer to table 15-2 . woms ? wired-or mode for serial pins this bit controls the two pins (txd and rxd) associated with the scix section. 0 = pins operate in a normal mode with both high and low drive capability. to affect the rxd bit, that bit would have to be configured as an output (via dds0/2) which is the single wire case when using the sci. woms bit still affects general purpose output on txd and rxd pins when scix is not using these pins. 1 = each pin operates in an open drain fashion if that pin is declared as an output . bit 7654321bit 0 loops woms rsrc m wake ilt pe pt reset: 0 0 0 0 0 0 0 0 sc0cr1/sc1cr1 ? sci control register 1 $00c2/$00ca
multiple serial interface serial communication interface (sci) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 243 rsrc ? receiver source when loops = 1, the rsrc bit determines the internal feedback path for the receiver. 0 = receiver input is connected to the transmitter internally (not txd pin) 1 = receiver input is connected to the txd pin m ? mode (select character format) 0 = one start, eight data, one stop bit 1 = one start, eight data, ninth data, one stop bit wake ? wake-up by address mark/idle 0 = wake up by idle line recognition 1 = wake up by address mark (last data bit set) ilt ? idle line type determines which of two types of idle line detection will be used by the sci receiver. 0 = short idle line mode is enabled. 1 = long idle line mode is detected. in the short mode, the sci circuitry begins counting ones in the search for the idle line condition immediately after the start bit. this means that the stop bit and any bits that were ones before the stop bit could be counted in that string of ones, resulting in earlier recognition of an idle line. table 15-2. loop mode functions loops rsrc ddsi(3) woms function of port s bit 1/3 0 x x x normal operations 1 0 0 0/1 loop mode without txd output(txd = high impedance) 1 0 1 1 loop mode with txd output (cmos) 1 0 1 1 loop mode with txd output (open-drain) 11 0 x single wire mode without txd output (the pin is used as receiver input only, txd = high impedance) 11 1 0 single wire mode with txd output (the output is also fed back to receiver input, cmos) 1 1 1 1 single wire mode for the receiving and transmitting(open-drain)
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 244 multiple serial interface motorola in the long mode, the sci circuitry does not begin counting ones in the search for the idle line condition until a stop bit is received. therefore, the last byte ? s stop bit and preceding ? 1 ? bits do not affect how quickly an idle line condition can be detected. pe ? parity enable 0 = parity is disabled. 1 = parity is enabled. pt ? parity type if parity is enabled, this bit determines even or odd parity for both the receiver and the transmitter. 0 = even parity is selected. an even number of ones in the data character causes the parity bit to be zero and an odd number of ones causes the parity bit to be one. 1 = odd parity is selected. an odd number of ones in the data character causes the parity bit to be zero and an even number of ones causes the parity bit to be one. read or write anytime. tie ? transmit interrupt enable 0 = tdre interrupts disabled 1 = sci interrupt will be requested whenever the tdre status flag is set. tcie ? transmit complete interrupt enable 0 = tc interrupts disabled 1 = sci interrupt will be requested whenever the tc status flag is set. bit 7654321bit 0 tie tcie rie ilie te re rwu sbk reset: 00000000 sc0cr2/sc1cr2 ? sci control register 2 $00c3/$00cb
multiple serial interface serial communication interface (sci) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 245 rie ? receiver interrupt enable 0 = rdrf and or interrupts disabled, raf interrupt in wait mode disabled 1 = sci interrupt will be requested whenever the rdrf or or status flag is set, or when raf is set while in wait mode with vddpll high. ilie ? idle line interrupt enable 0 = idle interrupts disabled 1 = sci interrupt will be requested whenever the idle status flag is set. te ? transmitter enable 0 = transmitter disabled 1 = sci transmit logic is enabled and the txd pin (port s bit 1/bit 3) is dedicated to the transmitter. the te bit can be used to queue an idle preamble. re ? receiver enable 0 = receiver disabled 1 = enables the sci receive circuitry. rwu ? receiver wake-up control 0 = normal sci receiver 1 = enables the wake-up function and inhibits further receiver interrupts. normally hardware wakes the receiver by automatically clearing this bit. sbk ? send break 0 = break generator off 1 = generate a break code (at least 10 or 11 contiguous zeros). as long as sbk remains set the transmitter will send zeros. when sbk is changed to zero, the current frame of all zeros is finished before the txd line goes to the idle state. if sbk is toggled on and off, the transmitter will send only 10 (or 11) zeros and then revert to mark idle or sending data.
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 246 multiple serial interface motorola the bits in these registers are set by various conditions in the sci hardware and are automatically cleared by special acknowledge sequences. the receive related flag bits in scxsr1 (rdrf, idle, or, nf, fe, and pf) are all cleared by a read of the scxsr1 register followed by a read of the transmit/receive data register low byte. however, only those bits which were set when scxsr1 was read will be cleared by the subsequent read of the transmit/receive data register low byte. the transmit related bits in scxsr1 (tdre and tc) are cleared by a read of the scxsr1 register followed by a write to the transmit/receive data registerl low byte. read anytime (used in auto clearing mechanism). write has no meaning or effect. tdre ? transmit data register empty flag new data will not be transmitted unless scxsr1 is read before writing to the transmit data register. reset sets this bit. 0 = scxdr busy 1 = any byte in the transmit data register is transferred to the serial shift register so new data may now be written to the transmit data register. tc ? transmit complete flag flag is set when the transmitter is idle (no data, preamble, or break transmission in progress). clear by reading scxsr1 with tc set and then writing to scxdr. 0 = transmitter busy 1 = transmitter is idle bit 7654321bit 0 tdre tc rdrf idle or nf fe pf reset: 11000000 sc0sr1/sc1sr1 ? sci status register 1 $00c4/$00cc
multiple serial interface serial communication interface (sci) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 247 rdrf ? receive data register full flag once cleared, idle is not set again until the rxd line has been active and becomes idle again. rdrf is set if a received character is ready to be read from scxdr. clear the rdrf flag by reading scxsr1 with rdrf set and then reading scxdr. 0 = scxdr empty 1 = scxdr full idle ? idle line detected flag receiver idle line is detected (the receipt of a minimum of 10/11 consecutive ones). this bit will not be set by the idle line condition when the rwu bit is set. once cleared, idle will not be set again until after rdrf has been set (after the line has been active and becomes idle again). 0 = rxd line is idle 1 = rxd line is active or ? overrun error flag new byte is ready to be transferred from the receive shift register to the receive data register and the receive data register is already full (rdrf bit is set). data transfer is inhibited until this bit is cleared. 0 = no overrun 1 = overrun detected nf ? noise error flag set during the same cycle as the rdrf bit but not set in the case of an overrun (or). 0 = unanimous decision 1 = noise on a valid start bit, any of the data bits, or on the stop bit fe ? framing error flag set when a zero is detected where a stop bit was expected. clear the fe flag by reading scxsr1 with fe set and then reading scxdr. 0 = stop bit detected 1 = zero detected rather than a stop bit
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 248 multiple serial interface motorola pf ? parity error flag indicates if received data ? s parity matches parity bit. this feature is active only when parity is enabled. the type of parity tested for is determined by the pt (parity type) bit in scxcr1. 0 = parity correct 1 = incorrect parity detected read anytime. write has no meaning or effect. scswai ? serial communications interface stop in wait mode 0 = sci clock operates normally. 1 = halt sci clock generation when in wait mode. raf ? receiver active flag this bit is controlled by the receiver front end. it is set during the rt1 time period of the start bit search. it is cleared when an idle state is detected or when the receiver circuitry detects a false start bit (generally due to noise or baud rate mismatch). 0 = a character is not being received 1 = a character is being received if enabled with rie = 1, raf set generates an interrupt when vddpll is high. bit 7654321bit 0 scswai mie (1) mdl1 (1) mdl0 (1) 000raf reset: 0 0 000000 sc0sr2 ? sci status register 2 $00c5/$00cd 1. see motorola interconnect bus for descriptions of these bits.
multiple serial interface serial communication interface (sci) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 249 r8 ? receive bit 8 read anytime. write has no meaning or affect. this bit is the ninth serial data bit received when the sci system is configured for nine-data-bit operation. t8 ? transmit bit 8 read or write anytime. this bit is the ninth serial data bit transmitted when the sci system is configured for nine-data-bit operation. when using 9-bit data format this bit does not have to be written for each data word. the same value will be transmitted as the ninth bit until this bit is rewritten. r7/t7 ? r0/t0 ? receive/transmit data bits 7 to 0 reads access the eight bits of the read-only sci receive data register (rdr). writes access the eight bits of the write-only sci transmit data register (tdr). scxdrl:scxdrh form the 9-bit data word for the sci. if the sci is being used with a 7- or 8-bit data word, only scxdrl needs to be accessed. if a 9-bit format is used, the upper register should be written first to ensure that it is transferred to the transmitter shift register with the lower register. bit 7654321bit 0 r8t8000000 reset: ???????? sc0drh/sc1drh ? sci data register high $00c6/$00ce bit 7654321bit 0 r7/t7 r6/t6 r5/t5 r4/t4 r3/t3 r2/t2 r1/t1 r0/t0 reset: ???????? sc0drl/sc1drl ? sci data register low $00c7/$00cf
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 250 multiple serial interface motorola 15.5 serial peripheral interface (spi) the serial peripheral interface allows the 68hc(9)12d60 to communicate synchronously with peripheral devices and other microprocessors. the spi system in the 68hc(9)12d60 can operate as a master or as a slave. the spi is also capable of interprocessor communications in a multiple master system. when the spi is enabled, all pins that are defined by the configuration as inputs will be inputs regardless of the state of the ddrs bits for those pins. all pins that are defined as spi outputs will be outputs only if the ddrs bits for those pins are set. any spi output whose corresponding ddrs bit is cleared can be used as a general-purpose input. a bidirectional serial pin is possible using the ddrs as the direction control. 15.5.1 spi baud rate generation the e clock is input to a divider series and the resulting spi clock rate may be selected to be e divided by 2, 4, 8, 16, 32, 64, 128 or 256. three bits in the sp0br register control the spi clock rate. this baud rate generator is activated only when spi is in the master mode and serial transfer is taking place. otherwise this divider is disabled to save power. 15.5.2 spi operation in the spi system the 8-bit data register in the master and the 8-bit data register in the slave are linked to form a distributed 16-bit register. when a data transfer operation is performed, this 16-bit register is serially shifted eight bit positions by the sck clock from the master so the data is effectively exchanged between the master and the slave. data written to the sp0dr register of the master becomes the output data for the slave and data read from the sp0dr register of the master after a transfer operation is the input data from the slave.
multiple serial interface serial peripheral interface (spi) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 251 figure 15-3. serial peripheral interface block diagram a clock phase control bit (cpha) and a clock polarity control bit (cpol) in the sp0cr1 register select one of four possible clock formats to be used by the spi system. the cpol bit simply selects non-inverted or inverted clock. the cpha bit is used to accommodate two fundamentally different protocols by shifting the clock by one half cycle or no phase shift. pin control logic 8-bit shift register read data buffer shift control logic clock logic spi control sp0sr spi status register sp0dr spi data register spif wcol modf divider select sp0br spi baud rate register 2 4 8 16 32 64 128 256 spi interrupt internal bus mcu p clock (same as e rate) s m m s m s spr2 spr1 spr0 request spie spe mstr cpol cpha lsbf lsbf pups rds swom spc0 ssoe spe clock mstr swom miso ps4 sck ps6 ss ps7 mosi ps5 sp0cr1 spi control register 1 sp0cr2 spi control register 2
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 252 multiple serial interface motorola figure 15-4. spi clock format 0 (cpha = 0) t l begin end sck (cpol=0) sample i change o sel ss (o) transfer sck (cpol=1) msb first (lsbf=0): lsb first (lsbf=1): msb lsb lsb msb bit 5 bit 2 bit 6 bit 1 bit 4 bit 3 bit 3 bit 4 bit 2 bit 5 bit 1 bit 6 change o sel ss (i) (mosi pin) (miso pin) (master only) (mosi/miso) t t if next transfer begins here for t t , t l , t l minimum 1/2 sck t i t l
multiple serial interface serial peripheral interface (spi) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 253 figure 15-5. spi clock format 1 (cpha = 1) 15.5.3 ss output available in master mode only, ss output is enabled with the ssoe bit in the sp0cr1 register if the corresponding ddrs is set. the ss output pin will be connected to the ss input pin of the external slave device. the ss output automatically goes low for each transmission to select the external device and it goes high during each idling state to deselect external devices. t l t t for t t , t l , t l minimum 1/2 sck t i t l if next transfer begins here begin end sck (cpol=0) sample i change o sel ss (o) transfer sck (cpol=1) msb first (lsbf=0): lsb first (lsbf=1): msb lsb lsb msb bit 5 bit 2 bit 6 bit 1 bit 4 bit 3 bit 3 bit 4 bit 2 bit 5 bit 1 bit 6 change o sel ss (i) (mosi pin) (miso pin) (master only) (mosi/miso) table 15-3. ss output selection dds7 ssoe master mode slave mode 00ss input with modf feature ss input 01 reserved ss input 1 0 general-purpose output ss input 11 ss output ss input
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 254 multiple serial interface motorola 15.5.4 bidirectional mode (momi or siso) in bidirectional mode, the spi uses only one serial data pin for external device interface. the mstr bit decides which pin to be used. the mosi pin becomes serial data i/o (momi) pin for the master mode, and the miso pin becomes serial data i/o (siso) pin for the slave mode. the direction of each serial i/o pin depends on the corresponding ddrs bit. when spe=1 master mode mstr=1 slave mode mstr=0 normal mode spc0=0 swom enables open drain output. swom enables open drain output. bidirectional mode spc0=1 swom enables open drain output. ps4 becomes gpio. swom enables open drain output. ps5 becomes gpio. figure 15-6. normal mode and bidirectional mode spi mo mi dds5 serial out serial in spi si so serial in serial out dds4 spi momi ps4 dds5 serial out serial in spi ps5 siso dds4 serial in serial out
multiple serial interface serial peripheral interface (spi) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 255 15.5.5 register descriptions control and data registers for the spi subsystem are described below. the memory address indicated for each register is the default address that is in use after reset. for more information refer to operating modes and resource mapping . read or write anytime. spie ? spi interrupt enable 0 = spi interrupts are inhibited 1 = hardware interrupt sequence is requested each time the spif or modf status flag is set spe ? spi system enable 0 = spi internal hardware is initialized and spi system is in a low- power disabled state. 1 = ps[4:7] are dedicated to the spi function when modf is set, spe always reads zero. sp0cr1 must be written as part of a mode fault recovery sequence. swom ? port s wired-or mode controls not only spi output pins but also the general-purpose output pins (ps[4:7]) which are not used by spi. 0 = spi and/or ps[4:7] output buffers operate normally 1 = spi and/or ps[4:7] output buffers behave as open-drain outputs mstr ? spi master/slave mode select 0 = slave mode 1 = master mode bit 7654321bit 0 spie spe swom mstr cpol cpha ssoe lsbf reset: 00000100 sp0cr1 ? spi control register 1 $00d0
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 256 multiple serial interface motorola cpol, cpha ? spi clock polarity, clock phase these two bits are used to specify the clock format to be used in spi operations. when the clock polarity bit is cleared and data is not being transferred, the sck pin of the master device is low. when cpol is set, sck idles high. see figure 15-4 and figure 15-5 . ssoe ? slave select output enable the ss output feature is enabled only in the master mode by asserting the ssoe and dds7. lsbf ? spi lsb first enable 0 = data is transferred most significant bit first 1 = data is transferred least significant bit first normally data is transferred most significant bit first.this bit does not affect the position of the msb and lsb in the data register. reads and writes of the data register will always have msb in bit 7. read or write anytime. spswai ? serial interface stop in wait mode 0 = serial interface clock operates normally 1 = halt serial interface clock generation in wait mode bit 7654321bit 0 0 0 0 0 0 0 spswai spc0 reset:00000000 sp0cr2 ? spi control register 2 $00d1
multiple serial interface serial peripheral interface (spi) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 257 spc0 ? serial pin control 0 this bit decides serial pin configurations with mstr control bit. read anytime. write anytime. at reset, e clock divided by 2 is selected. spr[2:0] ? spi clock (sck) rate select bits these bits are used to specify the spi clock rate. pin mode spc0 (1) 1. the serial pin control 0 bit enables bidirectional configurations. mstr miso (2) 2. slave output is enabled if dds4 = 1, ss = 0 and mstr = 0. (#1, #3) mosi (3) 3. master output is enabled if dds5 = 1 and mstr = 1. (#2, #4) sck (4) 4. sck output is enabled if dds6 = 1 and mstr = 1. (#2, #4) ss (5) 5. ss output is enabled if dds7 = 1, ssoe = 1 and mstr = 1. (#2, #4) #1 normal 0 0 slave out slave in sck in ss in #2 1 master in master out sck out ss i/o #3 bidirectional 1 0 slave i/o gpi/o sck in ss in #4 1 gpi/o master i/o sck out ss i/o bit 7654321bit 0 0 0 0 0 0 spr2 spr1 spr0 reset: 0 0 0 0 0 0 0 0 sp0br ? spi baud rate register $00d2 table 15-4. spi clock rate selection spr2 spr1 spr0 e clock divisor frequency at e clock = 4 mhz frequency at e clock = 8 mhz 0 0 0 2 2.0 mhz 4.0 mhz 0 0 1 4 1.0 mhz 2.0 mhz 0 1 0 8 500 khz 1.0 mhz 0 1 1 16 250 khz 500 khz 1 0 0 32 125 khz 250 khz 1 0 1 64 62.5 khz 125 khz 1 1 0 128 31.3 khz 62.5 khz 1 1 1 256 15.6 khz 31.3 khz
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 258 multiple serial interface motorola read anytime. write has no meaning or effect. spif ? spi interrupt request spif is set after the eighth sck cycle in a data transfer and it is cleared by reading the sp0sr register (with spif set) followed by an access (read or write) to the spi data register. wcol ? write collision status flag the mcu write is disabled to avoid writing over the data being transferred. no interrupt is generated because the error status flag can be read upon completion of the transfer that was in progress at the time of the error. automatically cleared by a read of the sp0sr (with wcol set) followed by an access (read or write) to the sp0dr register. 0 = no write collision 1 = indicates that a serial transfer was in progress when the mcu tried to write new data into the sp0dr data register. modf ? spi mode error interrupt status flag this bit is set automatically by spi hardware if the mstr control bit is set and the slave select input pin becomes zero. this condition is not permitted in normal operation. in the case where ddrs bit 7 is set, the ps7 pin is a general-purpose output pin or ss output pin rather than being dedicated as the ss input for the spi system. in this special case the mode fault function is inhibited and modf remains cleared. this flag is automatically cleared by a read of the sp0sr (with modf set) followed by a write to the sp0cr1 register. bit 7654321bit 0 spif wcol 0 modf 0 0 0 0 reset: 0 0 000000 sp0sr ? spi status register $00d3
multiple serial interface serial peripheral interface (spi) 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 259 read anytime (normally only after spif flag set). write anytime (see wcol write collision flag). reset does not affect this address. this 8-bit register is both the input and output register for spi data. reads of this register are double buffered but writes cause data to be written directly into the serial shifter. in the spi system the 8-bit data register in the master and the 8-bit data register in the slave are linked by the mosi and miso wires to form a distributed 16-bit register. when a data transfer operation is performed, this 16-bit register is serially shifted eight bit positions by the sck clock from the master so the data is effectively exchanged between the master and the slave. note that some slave devices are very simple and either accept data from the master without returning data to the master or pass data to the master without requiring data from the master. bit 7654321bit 0 bit 7654321bit 0 sp0dr ? spi data register $00d5
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 260 multiple serial interface motorola 15.6 port s in all modes, port s bits ps[7:0] can be used for either general-purpose i/o, or with the sci and spi subsystems. during reset, port s pins are configured as high-impedance inputs (ddrs is cleared). read anytime (inputs return pin level; outputs return pin driver input level). write data stored in internal latch (drives pins only if configured for output). writes do not change pin state when pin configured for spi or sci output. after reset all bits are configured as general-purpose inputs. port s shares function with the on-chip serial systems (spi and sci0/1). read or write anytime. after reset, all general-purpose i/o are configured for input only. 0 = configure the corresponding i/o pin for input only 1 = configure the corresponding i/o pin for output dds2, dds0 ? data direction for port s bit 2 and bit 0 if the sci receiver is configured for two-wire sci operation, corresponding port s pins will be input regardless of the state of these bits. ports ? port s data register $00d6 bit 7654321bit 0 ps7 ps6 ps5 ps4 ps3 ps2 ps1 ps0 pin function ss cs sck mosi momi miso siso txd1 rxd1 txd0 rxd0 bit 7654321bit 0 dds7 dds6 dds5 dds4 dds3 dds2 dds1 dds0 reset: 0 0 000000 ddrs ? data direction register for port s $00d7
multiple serial interface port s 68hc(9)12d60 ? rev 3.0 advance information motorola multiple serial interface 261 dds3, dds1 ? data direction for port s bit 3 and bit 1 if the sci transmitter is configured for two-wire sci operation, corresponding port s pins will be output regardless of the state of these bits. dds[6:4] ? data direction for port s bits 6 through 4 if the spi is enabled and expects the corresponding port s pin to be an input, it will be an input regardless of the state of the ddrs bit. if the spi is enabled and expects the bit to be an output, it will be an output only if the ddrs bit is set. dds7 ? data direction for port s bit 7 in spi slave mode, ddrs7 has no meaning or effect; the ps7 pin is dedicated as the ss input. in spi master mode, ddrs7 determines whether ps7 is an error detect input to the spi or a general-purpose or slave select output line. note: if mode fault error occurs, bits 5, 6 and 7 are forced to zero.
multiple serial interface advance information 68hc(9)12d60 ? rev 3.0 262 multiple serial interface motorola rdps2 ? reduce drive of port s[7:4] 0 = port s[7:4] output drivers operate normally 1 = port s[7:4] output pins have reduced drive capability for lower power and less noise rdps1 ? reduce drive of port s[3:2] 0 = port s[3:2] output drivers operate normally 1 = port s[3:2] output pins have reduced drive capability for lower power and less noise rdps0 ? reduce drive of port s[1:0] 0 = port s[1:0] output drivers operate normally 1 = port s[1:0] output pins have reduced drive capability for lower power and less noise pups2 ? pull-up port s[7:4] enable 0 = no internal pull-ups on port s[7:4] 1 = port s[7:4] input pins have an active pull-up device. if a pin is programmed as output, the pull-up device becomes inactive. pups1 ? pull-up port s[3:2] enable 0 = no internal pull-ups on port s[3:2] 1 = port s[3:2] input pins have an active pull-up device. if a pin is programmed as output, the pull-up device becomes inactive. pups0 ? pull-up port s[1:0] enable 0 = no internal pull-ups on port s[1:0] 1 = port s[1:0] input pins have an active pull-up device. if a pin is programmed as output, the pull-up device becomes inactive. bit 7654321bit 0 0 rdps2 rdps1 rdps0 0 pups2 pups1 pups0 reset: 00000000 purds ? pull-up register for port s $00d9
68hc(9)12d60 ? rev 3.0 advance information motorola motorola interconnect bus 263 advance information ? 68hc(9)12d60 section 16. motorola interconnect bus 16.1 contents 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 16.3 push-pull sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 16.4 biphase coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265 16.5 message validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 16.6 interfacing to mi bus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268 16.7 mi bus clock rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 16.8 sci0/mi bus registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 16.2 introduction the motorola interconnect bus (mi bus) is a serial communications protocol which supports distributed real-time control efficiently and with a high degree of noise immunity, at a typical data transfer bit rate of 20khz. the mi bus is suitable for medium speed networks requiring very low cost multiplex wiring; only one wire is required to connect to slave devices. (1) the mi bus uses a push-pull sequence to transfer data. the master device, which in this case is the 68hc(9)12d60, sends a push field to the slave devices connected to the bus. the push field contains data plus an address that is recognized by one of the slaves. the slave addressed returns data which the master pulls from the mi bus over the same wire. specific details of the message format are covered later in this section. 1. related information on motorola ? s mi bus is contained in the following motorola publications: eb409/d ? the mi bus and product family for multiplexing systems an475/d ? single wire mi bus controlling stepper motors br477/d ? smart mover ? stepper motors with integrated serial bus controller
motorola interconnect bus advance information 68hc(9)12d60 ? rev 3.0 264 motorola interconnect bus motorola the mcu (master) can take the bus at any time, with a start bit that violates the rules of manchester biphase encoding. up to eight slave devices may be addressed by the mi bus. other features of mi bus include message validation, error detection, and default value setting. on the 68hc(9)12d60 the mi bus module shares the same pins on port s as the sci0 module. data is transmitted (or ? pushed ? ) via the txd0 pin, and received ( ? pulled ? ) via the rxd0 pin. while data is being pushed, rxd0 will be disconnected from the receiver circuitry. the message frame is handled automatically in hardware. the mcu register interface is similar to that for the sci. 16.3 push-pull sequence communication between the mcu and the slave device always utilizes the same frame organization. first, the mcu sends serial data to the selected device. this data field is called the ? push field ? . at the end of the push field, the selected device automatically sends back to the mcu the data held during the push sequence. the mcu reads the serial data sent by the selected device. this data is called the ? pull field ? and contains status information followed by the end-of-frame information from the selected device. figure 16-1. mi bus timing 10 01 1 0 234 67 5 start stop start push sync d0 d1 d2 d3 d4 a0 a1 a2 pull sync s3 s2 s1 data address nrz data end of frame push field (driven by mcu) pull field (driven by slave) message frame push (biphase coded) pull (nrz coded) new frame push-pull function time slots txd0 pin (true data) mi bus wire bit fields
motorola interconnect bus biphase coding 68hc(9)12d60 ? rev 3.0 advance information motorola motorola interconnect bus 265 16.3.1 the push field the push field consists of a start bit, a push synchronization bit, a push data field and a push address field. the start consists of three time slots having the dominant logical state ? 0 ? . the start marks the beginning of the message frame by violation of the rule of the manchester code. the push synchronization bit consists of a biphase coded ? 0 ? . biphase coding will be discussed later. the push data field consists of five bits of biphase coded data. the push address consists of three bits of biphase coded data. data and address are written to the lower byte of the sci data register (sc0drl). the push data occupies the lower five bits and the push address occupies the upper three bits of the register. 16.3.2 the pull field the pull field consists of a pull synchronization bit, a pull data field and an end of frame. the pull synchronization bit is a biphase coded ? 1 ? and is initiated by the mcu during the time slot after the last address bit of the push field. the pull data field consists of an nrz coded transmission, each bit taking one time slot. once shifted in, the pull data is stored in the lower byte of the sci data register (sc0drl). the end-of-frame field is a square wave signal having a typical frequency of 20khz 1% tolerance (i.e. the bit rate of the push field) when the data sent to the selected device is valid. 16.4 biphase coding manchester biphase l coding is used for the push field bits. each bit requires two time slots to encode the logic value of the bit. this encoding allows the detection of a single error at the time slot level. bits are encoded as follows: 0 = in the first time slot, the logic level is set to one, followed by a logic level zero in the second time slot. 1 = in the first time slot, the logic level is set to zero, followed by a logic level one in the second time slot.
motorola interconnect bus advance information 68hc(9)12d60 ? rev 3.0 266 motorola interconnect bus motorola figure 16-2. biphase coding and error detection 16.5 message validation the communication between the mcu and the selected device is valid when the mcu reads a pull data field having correct codes (excluding the codes ? 111 ? and ? 000 ? ) followed by a square wave signal, having a frequency of 20khz, contained in the end-of-frame information. an mi bus error is detected when the pull field contains the code ? 111 ? followed by the end-of-frame permanently tied to logical state ? 1 ? . this means that the communication between the mcu and the selected device was not accomplished. ?0? ?1? 01234567 01234567 t biphase coded signal biphase detection noise detection abab a ? b ? aba ? b ? ab
motorola interconnect bus message validation 68hc(9)12d60 ? rev 3.0 advance information motorola motorola interconnect bus 267 figure 16-3. mi bus block diagram & loops woms wake + & & m ilt pe pt sc0cr1 10/11-bit tx shift register h8 l 0 7 10/11-bit rx shift register 80 7 tie te rie ilie re rwu sbk sc0cr2 tdre tc or rdrf sc0sr1 data recovery rxd0 txd0 receive buffer r8 transmit buffer t8 transmitter control receiver control sci interrupt request woms woms mie pt te sbk mie re stop start sc0bdl sc0bdh rate generator mclk rie idle ilie rdrf tc tcie tdre tie note: ? = always reads as zero flag control internal data bus rsrc ? ? ? tcie nf = not used in mi bus mode clock & scswai mdl1 mdl0 raf sc0sr2 mie
motorola interconnect bus advance information 68hc(9)12d60 ? rev 3.0 268 motorola interconnect bus motorola 16.5.1 controller detected errors there are three different mi bus error types which are detected by the selected slave device and are not mutually exclusive. the mcu cannot determine which error occurred. noise error ? slave devices take two samples in each time slot of the biphase encoded push field. an error occurs when the two samples for each time slot are not the same logical level. biphase error ? slave devices receiving the push field detect the biphase code. an error occurs when the two time slots of the biphase code do not yield a logical exclusive-or function. field error ? a field error is detected when the fixed-form of the push field is violated. 16.5.2 mcu detected errors there is a fourth error that can be detected by the mcu. this error causes the noise flag (nf) to be asserted in the sc0sr1 register during the push field sequence. bit error ? a bit error can be detected by the mcu during the push field. the mi bus serial system monitors the bus via on-chip hardware at the rxd0 pin at the same time as sending data. a bit error is detected at that bit time when the value monitored is different from the bit value sent. 16.6 interfacing to mi bus physically the mi bus consists of only a single wire. in the example shown in figure 16-4 , only a single transistor and a few passive components are required to connect up the 68hc(9)12d60 for full mi bus operation.
motorola interconnect bus interfacing to mi bus 68hc(9)12d60 ? rev 3.0 advance information motorola motorola interconnect bus 269 figure 16-4. a typical mi bus interface the transistor serves both to drive the mi bus during the push field and to protect the mcu tx pin from voltage transients generated in the wiring. without the transistor, emi could damage the tx pin. similarly, the input pin (rx) is protected from emi by clamping it to the mcu supply rails with two diodes. when a load dump occurs, the zener diode (18v) is switched on and hence turns the transistor on; this generates the logic ? 0 ? state on the mi bus. after eight time slots (200ms) of continuous ? 0 ? state, all devices on the mi bus will have their outputs disabled. the mi bus line can take two states, recessive or dominant. the dominant state ( ? 0 ? ) is represented by a maximum 0.3v (v cesat of the transistor, t1). the recessive state ( ? 1 ? ) is represented by 5v, through a pull-up resistor of 10k ? . the bus load depends on the number of devices on the bus. each device has a pull-up resistor of 10k ? . an external termination resistor is used to stabilize the load resistance of the bus at 600 ? . 1.2k ? +12v 18v 4.7k ? 3.9k ? 10k ? mi bus tx rx mcu v dd v dd t1 v dd v ss 10k ? 22k ?
motorola interconnect bus advance information 68hc(9)12d60 ? rev 3.0 270 motorola interconnect bus motorola 16.7 mi bus clock rate the mi bus clock rate is set via the sci baud registers. to use the mi bus, the mclk clock frequency that drives the sci clock generator must be selected to match the minimum resolution of the mi bus logic. this is expressed by the following formula: mclk = 16  n  (2  push_field_bit_rate) = 16  n  40khz = n  640khz where ? n ? is an integer and 20khz is the minimum push field bit rate for the mi bus. values for mclk could be 640khz,1280khz, 1920khz, ? , n  640khz. the value ? n ? is the modulus for the mi bus baud register. mclk may be the output of the pll circuit or it may be the extal/2 input of the mcu. refer to clock divider chains . 16.8 sci0/mi bus registers mi bus operation is controlled by the same group of registers as is used for the sci. however the functions of some of the bits are modified when in mi bus mode. a description of the registers, as applicable to the mi bus function, is given here. in mi bus mode, bits that have no meaning are reserved by motorola, and are not described. bit 7654321bit 0 btst bspl brld sbr12 sbr11 sbr10 sbr9 sbr8 high reset: 00000000 sc0bdh ? mi bus clock rate control register $00c0 bit 7654321bit 0 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 low reset: 0 0 000100 sc0bdl ? mi bus clock rate control register $00c1
motorola interconnect bus sci0/mi bus registers 68hc(9)12d60 ? rev 3.0 advance information motorola motorola interconnect bus 271 sc0bdh and sc0bdl are considered together as a 16-bit baud rate control register. read any time. write sbr[12:0] anytime. low order byte must be written for change to take effect. write sbr[15:13] only in special modes. the value in sbr[12:0] determines the clock rate of the mi bus. the desired baud rate is determined by the following formula: br is the value written to bits sbr[12:0] to establish baud rate. note: the baud rate generator is disabled until te or re bit in sc0cr2 register is set for the first time after reset, and/or the baud rate generator is disabled when sbr[12:0] = 0. btst ? reserved for test function bspl ? reserved for test function brld ? reserved for test function read or write anytime. woms ? wired-or mode for serial pins this bit controls the two pins (txd0 and rxd0) associated with the sc0 section. 0 = pins operate in a normal mode with both high and low drive capability. 1 = each pin operates in an open drain fashion if that pin is declared as an output . mi bus clock rate mclk 16 br bit 7654321bit 0 ? woms ????? pt reset: 00000000 sc0cr1 ? mi bus control register 1 $00c2
motorola interconnect bus advance information 68hc(9)12d60 ? rev 3.0 272 motorola interconnect bus motorola pt ? mi bus txd0 polarity if parity is enabled, this bit determines even or odd parity for both the receiver and the transmitter. 0 = mi bus transmit pin functions normally. 1 = mi bus transmit pin will send inverted data. read or write anytime. rie ? receiver interrupt enable 0 = rdrf interrupt disabled. 1 = mi bus interrupt will be requested whenever the rdrf status flag is set. or does not generate an interrupt request in mi bus mode. te ? transmitter enable 0 = transmitter disabled. 1 = mi bus transmit logic is enabled and the txd0 pin (port s bit 1) is dedicated to the transmitter. re ? receiver enable 0 = receiver disabled. 1 = port pin dedicated to the mi bus; the receiver is enabled by a pull sync and is inhibited during a push field. sbk ? send break 0 = no action. 1 = mi transmit line is set low for 20 time slots. when an mi bus wire is held low for eight or more time slots an internal circuit on any slave device connected to the bus may reset or preset the device with default values. bit 7654321bit 0 ?? rie ? te re ? sbk reset:00000000 sc0cr2 ? mi bus control register 2 $00c3
motorola interconnect bus sci0/mi bus registers 68hc(9)12d60 ? rev 3.0 advance information motorola motorola interconnect bus 273 the bits in these registers are set by various conditions in the mi bus hardware and are automatically cleared by special acknowledge sequences. the receive related flag bits in sc0sr1 (rdrf, or and nf) are all cleared by a read of this register followed by a read of the transmit/receive data register low byte. however, only those bits which were set when sc0sr1 was read will be cleared by the subsequent read of the transmit/receive data register low byte. read anytime (used in auto clearing mechanism). write has no meaning or effect. rdrf ? receive data register full flag 0 = contents of the receiver shift register have not been transferred to the receiver data register. 1 = contents of the receiver serial shift register have been transferred to the receiver data register. the eof (end-of-frame) during an mi bus pull-field is a continuous square wave, which will result in multiple rdrfs. this may be dealt with in any of the following ways: ? by clearing the rie mask, ignoring unneeded rdrfs, initiating a push field, waiting for tdre (1) and then clearing the rdrf ? by clearing the re bit when a pull field is complete, followed by setting the re bit after the tdre 1 flag associated with the next push field is asserted. ? by disabling the mi bus. bit 7654321bit 0 ?? rdrf ? or nf ?? reset: 1 1 000000 sc0sr1 ? mi bus status register 1 $00c4 1. note that tdre and tc will both behave in the same way as during normal sci transmissions. the mi bus will still be receiving when the tc bit becomes set, hence any queued transmission will not start until the current pull field has finished. see also register descriptions .
motorola interconnect bus advance information 68hc(9)12d60 ? rev 3.0 274 motorola interconnect bus motorola or ? bit error flag 0 = no bit error has been detected. 1 = a bit error has been detected. this bit is set when a push field bit value on the mi bus does not match the bit value that was sent. this is known as an mi bus bit error. or does not generate an interrupt request in mi bus mode. nf ? noise error flag 0 = no noise detected. 1 = noise detected. this bit is set when noise is detected on the receive line during an mi bus pull field. read anytime. write has no meaning or effect. scswai ? serial communications interface stop in wait mode 0 = sci clock operates normally. 1 = halt sci clock generation when in wait mode. mie ? motorola interface bus (mi bus) enable 0 = the sci functions normally. 1 = mi bus is enabled for this subsystem. when mie is set, the sci0 registers, bits and pins assume the functionality required for mi bus. mdl1, mdl0 ? mi bus delay select these bits are used to set up the delay for the start of the nrz receive for mi bus operation as shown (for a 20khz bit rate) in the following table. bit 7654321bit 0 scswai mie mdl1 mdl0 0 0 0 raf reset: 0 0 0 0 0 0 0 0 sc0sr2 ? mi bus status register 2 $00c5
motorola interconnect bus sci0/mi bus registers 68hc(9)12d60 ? rev 3.0 advance information motorola motorola interconnect bus 275 raf ? receiver active flag 0 = a character is not being received 1 = a character is being received this register forms the 8-bit data/address word for the mi push field and contains the 3-bit data word received as the mi pull field. r7t7 ? r0t0 ? receive/transmit data bits 7 to 0 read: reads access the three bits of pull field data (stored in bits 3 ? 1) of the read-only mi bus receive data register. bits [7:4, 0] are a fixed data pattern when a valid status and end-of-frame is returned. a valid status is represented by the following data pattern: 0101 xxx1 (bits 7 ? 0), where ? xxx ? is the status. all ones in the receive data register indicate that an error occurred on the mi bus. bits are received lsb first by the mcu, and the status bits map as shown in the above table. table 16-1. mi bus delay mdl1 mdl0 delay factor delay time (1) 1. 20khz bit rate requires 25 s (40khz) time slots. 00 1 1.5625 s (2) 2. 25 s 16 0 1 2 3.125 s 1 0 3 4.6875 s 11 46.25 s bit 7654321bit 0 r7/t7 r6/t6 r5/t5 r4/t4 r3/t3 r2/t2 r1/t1 r0/t0 pull field 0 1 0 1 s1 s2 s3 1 push fielda2a1a0d4d3d2d1d0 reset: ???????? sc0drl ? mi bus data register low $00c7
motorola interconnect bus advance information 68hc(9)12d60 ? rev 3.0 276 motorola interconnect bus motorola write: writes access the eight bits of the write-only mi bus transmit data register. mi bus devices require a 5-bit data pattern followed by a 3-bit address pattern to be sent during the push field. the data pattern is mapped to the lowest five bits of the data register and the address to the highest three bits, as shown in the above table. thus mi-data[4:0] is written to sc0drl[4:0] and mi-address[2:0] is written to sc0drl[7:5].
68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 277 advance information ? 68hc(9)12d60 section 17. mscan controller 17.1 contents 17.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 17.3 external pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 17.4 message storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279 17.5 identifier acceptance filter . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 17.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 17.7 protocol violation protection. . . . . . . . . . . . . . . . . . . . . . . . . . 289 17.8 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290 17.9 timer link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 17.10 clock system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 17.11 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 17.12 programmer ? s model of message storage . . . . . . . . . . . . . . .298 17.13 programmer ? s model of control registers . . . . . . . . . . . . . . . 303 17.2 introduction the mscan12 is the specific implementation of the motorola scalable can (mscan) concept targeted for the motorola m68hc12 microcontroller family. the module is a communication controller implementing the can 2.0 a/b protocol as defined in the bosch specification dated september 1991. the can protocol was primarily, but not only, designed to be used as a vehicle serial data bus, meeting the specific requirements of this field:
mscan controller advance information 68hc(9)12d60 ? rev 3.0 278 mscan controller motorola real-time processing, reliable operation in the emi environment of a vehicle, cost-effectiveness and required bandwidth. mscan12 utilises an advanced buffer arrangement resulting in a predictable real-time behaviour and simplifies the application software. 17.3 external pins the mscan12 uses 2 external pins, 1 input (rxcan) and 1 output (txcan). the txcan output pin represents the logic level on the can: 0 is for a dominant state, and 1 is for a recessive state. rxcan is on bit 0 of port can, txcan is on bit 1. the remaining six pins of port can (112tqfp version only) are controlled by registers in the mscan12 address space (see mscan12 port can control register (pctlcan) and mscan12 port can data direction register (ddrcan) ). a typical can system with mscan12 is shown in figure 17-1 . each can station is connected physically to the can bus lines through a transceiver chip. the transceiver is capable of driving the large current needed for the can and has current protection, against defective can or defective stations.
mscan controller message storage 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 279 figure 17-1. the can system 17.4 message storage mscan12 facilitates a sophisticated message storage system which addresses the requirements of a broad range of network applications. 17.4.1 background modern application layer software is built upon two fundamental assumptions: 1. any can node is able to send out a stream of scheduled messages without releasing the bus between two messages. such nodes will arbitrate for the bus right after sending the previous message and will only release the bus when arbitration is lost. 2. the internal message queue within any can node is organized such that if more than one message is ready to be sent, the highest priority message will be sent out first. transceiver mscan12 can system can station 1 can station 2 can station n can txcan rxcan ..... controller
mscan controller advance information 68hc(9)12d60 ? rev 3.0 280 mscan controller motorola the above behaviour cannot be achieved with a single transmit buffer. that buffer must be reloaded right after the previous message has been sent. this loading process lasts a definite amount of time and has to be completed within the inter-frame sequence (ifs) in order to be able to send an uninterrupted stream of messages. even if this is feasible for limited can bus speeds it requires that the cpu reacts with short latencies to the transmit interrupt. a double buffer scheme would de-couple the re-loading of the transmit buffers from the actual message sending and as such reduces the reactiveness requirements on the cpu. problems may arise if the sending of a message would be finished just while the cpu re-loads the second buffer, no buffer would then be ready for transmission and the bus would be released. at least three transmit buffers are required to meet the first of above requirements under all circumstances. the mscan12 has three transmit buffers. the second requirement calls for some sort of internal prioritisation which the mscan12 implements with the local priority concept described below. 17.4.2 receive structures the received messages are stored in a two stage input fifo. the two message buffers are alternately mapped into a single memory area (see figure 17-2 ). while the background receive buffer (rxbg) is exclusively associated to the mscan12, the foreground receive buffer (rxfg) is addressable by the cpu12. this scheme simplifies the handler software as only one address area is applicable for the receive process. both buffers have a size of 13 bytes to store the can control bits, the identifier (standard or extended) and the data contents (for details see programmer ? s model of message storage ). the receiver full flag (rxf) in the mscan12 receiver flag register (crflg) (see mscan12 receiver flag register (crflg) ) signals the status of the foreground receive buffer. when the buffer contains a correctly received message with matching identifier this flag is set.
mscan controller message storage 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 281 on reception, each message is checked to see if it passes the filter (for details see identifier acceptance filter ) and in parallel is written into rxbg. the mscan12 copies the content of rxbg into rxfg (1) , sets the rxf flag, and generates a receive interrupt to the cpu (2) . the user ? s receive handler has to read the received message from rxfg and then reset the rxf flag in order to acknowledge the interrupt and to release the foreground buffer. a new message, which can follow immediately after the ifs field of the can frame, is received into rxbg. the over- writing of the background buffer is independent of the identifier filter function. 1. only if the rxf flag is not set. 2. the receive interrupt is generated only if not masked. a polling scheme can be applied on rxf also.
mscan controller advance information 68hc(9)12d60 ? rev 3.0 282 mscan controller motorola figure 17-2. user model for message buffer organization when the mscan12 module is transmitting, the mscan12 receives its own messages into the background receive buffer, rxbg, but does not overwrite rxfg, generate a receive interrupt or acknowledge its own messages on the can bus. the exception to this rule is in loop-back mode (see mscan12 module control register 1 (cmcr1). ) where the mscan12 treats its own messages exactly like all other incoming messages. the mscan12 receives its own transmitted messages in the event that it loses arbitration. if arbitration is lost, the mscan12 must be prepared to become receiver. rxfg rxbg tx0 rxf txe prio tx1 txe prio tx2 txe prio mscan12 cpu bus
mscan controller message storage 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 283 an overrun condition occurs when both the foreground and the background receive message buffers are filled with correctly received messages with accepted identifiers and another message is correctly received from the bus with an accepted identifier. the latter message is discarded and an error interrupt with overrun indication is generated if enabled. the mscan12 is still able to transmit messages with both receive message buffers filled, but all incoming messages are discarded. 17.4.3 transmit structures the mscan12 has a triple transmit buffer scheme in order to allow multiple messages to be set up in advance and to achieve an optimized real-time performance. the three buffers are arranged as shown in figure 17-2 . all three buffers have a 13 byte data structure similar to the outline of the receive buffers (see programmer ? s model of message storage ). an additional transmit buffer priority register (tbpr) contains an 8-bit so called local priority field (prio) (see transmit buffer priority registers (tbpr) ). in order to transmit a message, the cpu12 has to identify an available transmit buffer which is indicated by a set transmit buffer empty (txe) flag in the mscan12 transmitter flag register (ctflg) (see mscan12 transmitter flag register (ctflg) ). the cpu12 then stores the identifier, the control bits and the data content into one of the transmit buffers. finally, the buffer has to be flagged as being ready for transmission by clearing the txe flag. the mscan12 will then schedule the message for transmission and will signal the successful transmission of the buffer by setting the txe flag. a transmit interrupt will be emitted (1) when txe is set and this can be used to drive the application software to re-load the buffer. 1. the transmit interrupt is generated only if not masked. a polling scheme can be applied on txe also.
mscan controller advance information 68hc(9)12d60 ? rev 3.0 284 mscan controller motorola if more than one buffer is scheduled for transmission when the can bus becomes available for arbitration, the mscan12 uses the local priority setting of the three buffers for prioritisation. for this purpose every transmit buffer has an 8-bit local priority field (prio). the application software sets this field when the message is set up. the local priority reflects the priority of this particular message relative to the set of messages being emitted from this node. the lowest binary value of the prio field is defined to be the highest priority. the internal scheduling process takes places whenever the mscan12 arbitrates for the bus. this is also the case after the occurrence of a transmission error. when a high priority message is scheduled by the application software it may become necessary to abort a lower priority message being set up in one of the three transmit buffers. as messages that are already under transmission cannot be aborted, the user has to request the abort by setting the corresponding abort request flag (abtrq) in the transmission control register (ctcr). the mscan12 grants the request, if possible, by setting the corresponding abort request acknowledge (abtak) and the txe flag in order to release the buffer and by generating a transmit interrupt. the transmit interrupt handler software can tell from the setting of the abtak flag whether the message was aborted (abtak=1) or sent in the meantime (abtak=0). 17.5 identifier acceptance filter the identifier acceptance registers (cidar0 ? 7) define the acceptable patterns of the standard or extended identifier (id10 ? id0 or id28 ? id0). any of these bits can be marked don ? t care in the identifier mask registers (cidmr0 ? 7). a filter hit is indicated to the application software by a set rxf (receive buffer full flag, see mscan12 receiver flag register (crflg) ) and three bits in the identifier acceptance control register (see mscan12 identifier acceptance control register (cidac) ). these identifier hit flags (idhit2 ? 0) clearly identify the filter section that caused the acceptance. they simplify the application software ? s task to identify the
mscan controller identifier acceptance filter 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 285 cause of the receiver interrupt. when more than one hit occurs (two or more filters match) the lower hit has priority. a very flexible programmable generic identifier acceptance filter has been introduced in order to reduce the cpu interrupt loading. the filter is programmable to operate in four different modes:  two identifier acceptance filters, each to be applied to a) the full 29 bits of the extended identifier and to the following bits of the can frame: rtr, ide, srr or b) the 11 bits of the standard identifier, the rtr and ide bits of can 2.0a/b messages. this mode implements two filters for a full length can 2.0b compliant extended identifier. figure 17-3 shows how the first 32-bit filter bank (cidar0 ? 3, cidmr0 ? 3) produces a filter 0 hit. similarly, the second filter bank (cidar4 ? 7, cidmr4 ? 7) produces a filter 1 hit.  four identifier acceptance filters, each to be applied to a) the 14 most significant bits of the extended identifier plus the srr and ide bits of can 2.0b messages or b) the 11 bits of the standard identifier, the rtr and ide bits of can 2.0a/b mesages. figure 17-4 shows how the first 32-bit filter bank (cidar0 ? 3, cidmr0 ? 3) produces filter 0 and 1 hits. similarly, the second filter bank (cidar4 ? 7, cidmr4 ? 7) produces filter 2 and 3 hits.  eight identifier acceptance filters, each to be applied to the first 8 bits of the identifier. this mode implements eight independent filters for the first 8 bits of a can 2.0a/b compliant standard identifier or of a can 2.0b compliant extended identifier. figure 17-5 shows how the first 32-bit filter bank (cidar0 ? 3, cidmr0 ? 3) produces filter 0 to 3 hits. similarly, the second filter bank (cidar4 ? 7, cidmr4 ? 7) produces filter 4 to 7 hits.  closed filter. no can message will be copied into the foreground buffer rxfg, and the rxf flag will never be set.
mscan controller advance information 68hc(9)12d60 ? rev 3.0 286 mscan controller motorola figure 17-3. 32-bit maskable identifier acceptance filters figure 17-4. 16-bit maskable acceptance filters cidmr2 id28 id21 id20 id15 id14 id7 id6 rtr id10 id3 id2 ide ac7 idr0 idr0 idr1 idr1 idr2 idr3 ac0 ac7 ac0 ac7 ac7 ac0 ac0 ac7 ac0 ac7 ac0 ac7 ac0 ac7 ac0 cidmro cidmr1 cidmr3 cidar3 cidar2 cidar1 cidaro id accepted (filter 0 hit) id28 id21 id20 id15 id14 id7 id6 rtr id10 id3 id2 ide ac7 idr0 idr0 idr1 idr1 idr2 idr3 ac0 ac7 ac0 ac7 ac0 ac7 ac0 cidmro cidmr1 cidar1 cidaro id accepted (filter 0 hit) id accepted (filter 1 hit) ac7 ac0 ac7 ac0 ac7 ac0 ac7 ac0 cidmr2 cidmr3 cidar3 cidar2
mscan controller interrupts 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 287 figure 17-5. 8-bit maskable acceptance filters 17.6 interrupts the mscan12 supports four interrupt vectors mapped onto eleven different interrupt sources, any of which can be individually masked (for details see mscan12 receiver flag register (crflg) to mscan12 transmitter control register (ctcr) ): id28 id21 id20 id15 id14 id7 id6 rtr id10 id3 id2 ide ac7 idr0 idr0 idr1 idr1 idr2 idr3 ac0 ac7 ac0 cidmro cidaro id accepted (filter 0 hit) ac7 ac0 ac7 ac0 cidmr1 cidar1 ac7 ac0 ac7 ac0 cidmr2 cidar2 id accepted (filter 1 hit) id accepted (filter 2 hit) ac7 ac0 ac7 ac0 cidmr3 cidar3
mscan controller advance information 68hc(9)12d60 ? rev 3.0 288 mscan controller motorola  transmit interrupt : at least one of the three transmit buffers is empty (not scheduled) and can be loaded to schedule a message for transmission. the txe flags of the empty message buffers are set.  receive interrupt : a message has been successfully received and loaded into the foreground receive buffer. this interrupt is generated immediately after receiving the eof symbol. the rxf flag is set.  wake-up interrupt : an activity on the can bus occurred during mscan12 internal sleep mode.  error interrupt : an overrun, error or warning condition occurred. the receiver flag register (crflg) indicates one of the following conditions: ? overrun: an overrun condition as described in receive structures has occurred. ? receiver warning : the receive error counter has reached the cpu warning limit of 96. ? transmitter warning : the transmit error counter has reached the cpu warning limit of 96. ? receiver error passive : the receive error counter has exceeded the error passive limit of 127 and mscan12 has gone to error passive state. ? transmitter error passive : the transmit error counter has exceeded the error passive limit of 127 and mscan12 has gone to error passive state. ? bus off : the transmit error counter has exceeded 255 and mscan12 has gone to busoff state. 17.6.1 interrupt acknowledge interrupts are directly associated with one or more status flags in either the mscan12 receiver flag register (crflg) or the mscan12 transmitter flag register (ctflg). interrupts are pending as long as one of the corresponding flags is set. the flags in above registers must be
mscan controller protocol violation protection 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 289 reset within the interrupt handler in order to handshake the interrupt. the flags are reset through writing a 1 to the corresponding bit position. a flag cannot be cleared if the respective condition still prevails. note: bit manipulation instructions (bset) shall not be used to clear interrupt flags. 17.6.2 interrupt vectors the mscan12 supports four interrupt vectors as shown in table 17-1 . the vector addresses and the relative interrupt priority are dependent on the chip integration and to be defined. 17.7 protocol violation protection the mscan12 will protect the user from accidentally violating the can protocol through programming errors. the protection logic implements the following features:  the receive and transmit error counters cannot be written or otherwise manipulated. table 17-1. mscan12 interrupt vectors function source local mask global mask wake-up wupif wupie i bit error interrupts rwrnif rwrnie twrnif twrnie rerrif rerrie terrif terrie boffif boffie ovrif ovrie receive rxf rxfie transmit txe0 txeie0 txe1 txeie1 txe2 txeie2
mscan controller advance information 68hc(9)12d60 ? rev 3.0 290 mscan controller motorola  all registers which control the configuration of the mscan12 cannot be modified while the mscan12 is on-line. the sftres bit in cmcr0 (see mscan12 module control register 0 (cmcr0) ) serves as a lock to protect the following registers: ? mscan12 module control register 1 (cmcr1) ? mscan12 bus timing register 0 and 1 (cbtr0, cbtr1) ? mscan12 identifier acceptance control register (cidac) ? mscan12 identifier acceptance registers (cidar0 ? 7) ? mscan12 identifier mask registers (cidmr0 ? 7)  the txcan pin is forced to recessive when the mscan12 is in any of the low power modes. 17.8 low power modes in addition to normal mode, the mscan12 has three modes with reduced power consumption: sleep, soft_reset and power_down mode. in sleep and soft_reset modes, power consumption is reduced by stopping all clocks except those to access the registers. in power_down mode, all clocks are stopped and no power is consumed. the wai and stop instructions put the mcu in low power consumption stand-by modes. table 17-2 summarizes the combinations of mscan12 and cpu modes. a particular combination of modes is entered for the given settings of the bits cswai, slpak, and sftres. for all modes, an mscan wake-up interrupt can occur only if slpak=wupie=1. while the cpu is in wait mode, the mscan12 can be operated in normal mode and generate interrupts (registers can be accessed via background debug mode).
mscan controller low power modes 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 291 17.8.1 mscan12 sleep mode the cpu can request the mscan12 to enter this low-power mode by asserting the slprq bit in the module configuration register (see figure 17-6 ). the time when the mscan12 enters sleep mode depends on its activity:  if there are one or more message buffers scheduled for transmission (txex = 0), the mscan will continue to transmit until all transmit message buffers are empty (txex = 1, transmitted successfully or aborted) and then goes into sleep mode.  if it is receiving, it continues to receive and goes into sleep mode as soon as the can bus next becomes idle.  if it is neither transmitting nor receiving, it immediately goes into sleep mode. note: the application software must avoid setting up a transmission (by clearing one or more txe flag(s)) and immediately request sleep mode (by setting slprq). it then depends on the exact sequence of operations whether the mscan12 starts transmitting or goes into sleep mode directly. table 17-2. mscan12 vs. cpu operating modes mscan mode cpu mode stop wait run power_down cswai = x (1) slpak = x sftres = x 1. x means don ? t care. cswai = 1 slpak = x sftres = x sleep cswai = 0 slpak = 1 sftres = 0 cswai = x slpak = 1 sftres = 0 soft_reset cswai = 0 slpak = 0 sftres = 1 cswai = x slpak = 0 sftres = 1 normal cswai = 0 slpak = 0 sftres = 0 cswai = x slpak = 0 sftres = 0
mscan controller advance information 68hc(9)12d60 ? rev 3.0 292 mscan controller motorola during sleep mode, the slpak flag is set. the application software should use slpak as a handshake indication for the request (slprq) to go into sleep mode. when in sleep mode, the mscan12 stops its internal clocks. however, clocks to allow register accesses still run. if the mscan12 is in bus-off state, it stops counting the 128*11 consecutive recessive bits due to the stopped clocks. the txcan pin stays in recessive state. if rxf=1, the message can be read and rxf can be cleared. copying of rxbg into rxfg doesn ? t take place while in sleep mode. it is possible to access the transmit buffers and to clear the txe flags. no message abort takes place while in sleep mode. the mscan12 leaves sleep mode (wake-up) when  bus activity occurs or  the mcu clears the slprq bit or  the mcu sets sftres. note: the mcu cannot clear the slprq bit before the mscan12 is in sleep mode (slpak = 1). after wake-up, the mscan12 waits for 11 consecutive recessive bits to synchronize to the bus. as a consequence, if the mscan12 is woken-up by a can frame, this frame is not received. the receive message buffers (rxfg and rxbg) contain messages if they were received before sleep mode was entered. all pending actions are executed upon wake-up: copying of rxbg into rxfg, message aborts and message transmissions. if the mscan12 is still in bus-off state after sleep mode was left, it continues counting the 128*11 consecutive recessive bits.
mscan controller low power modes 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 293 figure 17-6. sleep request / acknowledge cycle 17.8.2 mscan12 soft_reset mode in soft_reset mode, the mscan12 is stopped. registers can still be accessed. this mode is used to initialize the module configuration, bit timing, and the can message filter. see mscan12 module control register 0 (cmcr0) for a complete description of the soft_reset mode. when setting the sftres bit, the mscan12 immediately stops all ongoing transmissions and receptions, potentially causing the can protocol violations. note: the user is responsible for ensuring that the mscan12 is not active when soft_reset mode is entered. the recommended procedure is to bring the mscan12 into sleep mode before the sftres bit is set. mscan12 sleeping slprq = 1 slpak = 1 mscan12 running slprq = 0 slpak = 0 sleep request slprq = 1 slpak = 0 mcu mscan12 mcu or mscan12
mscan controller advance information 68hc(9)12d60 ? rev 3.0 294 mscan controller motorola 17.8.3 mscan12 power_down mode the mscan12 is in power_down mode when  the cpu is in stop mode or  the cpu is in wait mode and the cswai bit is set (see mscan12 module control register 0 (cmcr0) ). when entering the power_down mode, the mscan12 immediately stops all ongoing transmissions and receptions, potentially causing can protocol violations. note: the user is responsible for ensuring that the mscan12 is not active when power_down mode is entered. the recommended procedure is to bring the mscan12 into sleep mode before the stop instruction (or the wai instruction, if cswai is set) is executed. to protect the can bus system from fatal consequences of violations to the above rule, the mscan12 drives the txcan pin into recessive state. in power_down mode no registers can be accessed. 17.8.4 programmable wake-up function the mscan12 can be programmed to apply a low-pass filter function to the rxcan input line while in sleep mode (see control bit wupm in the module control register, mscan12 module control register 1 (cmcr1). ). this feature can be used to protect the mscan12 from wake-up due to short glitches on the can bus lines. such glitches can result from electromagnetic interference within noisy environments. 17.9 timer link the mscan12 generates a timer signal whenever a valid frame has been received. because the can specification defines a frame to be valid if no errors occurred before the eof field has been transmitted successfully, the timer signal is generated right after the eof. a pulse of
mscan controller clock system 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 295 one bit time is generated. as the mscan12 receiver engine also receives the frames being sent by itself, a timer signal is also generated after a successful transmission. the previously described timer signal can be routed into the on-chip timer interface module (ect). this signal is connected to the timer n channel m input (1) under the control of the timer link enable (tlnken) bit in the cmcr0. after timer n has been programmed to capture rising edge events, it can be used under software control to generate 16-bit time stamps which can be stored with the received message. 17.10 clock system figure 17-7 shows the structure of the mscan12 clock generation circuitry. with this flexible clocking scheme the mscan12 is able to handle can bus rates ranging from 10 kbps up to 1 mbps. figure 17-7. clocking scheme the clock source bit (clksrc) in the mscan12 module control register (cmcr1) (see mscan12 bus timing register 0 (cbtr0) ) defines whether the mscan12 is connected to the output of the crystal oscillator (extali) or to a clock twice as fast as the system clock (eclk). the clock source has to be chosen such that the tight oscillator tolerance requirements (up to 0.4%) of the can protocol are met. additionally, for high can bus rates (1 mbps), a 50% duty cycle of the clock is required. 1. the timer channel being used for the timer link is integration dependent. mscan12 cgm sysclk extali cgmcanclk prescaler (1...64) time quanta clock clksrc clksrc
mscan controller advance information 68hc(9)12d60 ? rev 3.0 296 mscan controller motorola note: if the system clock is generated from a pll, it is recommended to select the crystal clock source rather than the system clock source due to jitter considerations, especially at faster can bus rates. for microcontrollers without the cgm module, cgmcanclk is driven from the crystal oscillator (extali). a programmable prescaler is used to generate out of mscanclk the time quanta (tq) clock. a time quantum is the atomic unit of time handled by the mscan12. a bit time is subdivided into three segments (1) :  sync_seg: this segment has a fixed length of one time quantum. signal edges are expected to happen within this section.  time segment 1: this segment includes the prop_seg and the phase_seg1 of the can standard. it can be programmed by setting the parameter tseg1 to consist of 4 to 16 time quanta.  time segment 2: this segment represents the phase_seg2 of the can standard. it can be programmed by setting the tseg2 parameter to be 2 to 8 time quanta long. the synchronisation jump width can be programmed in a range of 1 to 4 time quanta by setting the sjw parameter. above parameters can be set by programming the bus timing registers (cbtr0 ? 1, see mscan12 bus timing register 0 (cbtr0) and mscan12 bus timing register 1 (cbtr1). ). note: it is the user ? s responsibility to make sure that his bit time settings are in compliance with the can standard. table 17-3 gives an overview on the can conforming segment settings and the related parameter values. 1. for further explanation of the under-lying concepts please refer to iso/dis 11519-1, section 10.3. f t q f cgmcanclk presc value ? ------------------------------------------ - = bitrate f t q number of timequanta ?? ------------------------------------------------------------------------ =
mscan controller clock system 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 297 figure 17-8. segments within the bit time table 17-3. can standard compliant bit time segment settings time segment 1 tseg1 time segment 2 tseg2 synchron. jump width sjw 5 .. 10 4 .. 9 2 1 1 .. 2 0 .. 1 4 .. 11 3 .. 10 3 2 1 .. 3 0 .. 2 5 .. 12 4 .. 11 4 3 1 .. 4 0 .. 3 6 .. 13 5 .. 12 5 4 1 .. 4 0 .. 3 7 .. 14 6 .. 13 6 5 1 .. 4 0 .. 3 8 .. 15 7 .. 14 7 6 1 .. 4 0 .. 3 9 .. 16 8 .. 15 8 7 1 .. 4 0 .. 3 sync _seg time segment 1 time seg. 2 1 4 ... 16 2 ... 8 8... 25 time quanta = 1 bit time nrz signal sample point (single or triple sampling) (prop_seg + phase_seg1) (phase_seg2) transmit point
mscan controller advance information 68hc(9)12d60 ? rev 3.0 298 mscan controller motorola 17.11 memory map the mscan12 occupies 128 bytes in the cpu12 memory space. the background receive buffer can only be read in test mode. 17.12 programmer ? s model of message storage the following section details the organisation of the receive and transmit message buffers and the associated control registers. for reasons of programmer interface simplification the receive and transmit message buffers have the same outline. each message buffer allocates 16 bytes in the memory map containing a 13 byte data structure. an additional transmit buffer priority register (tbpr) is defined for the transmit buffers. figure 17-9. mscan12 memory map $0100 control registers 9 bytes $0108 $0109 reserved 5 bytes $010d $010e error counters 2 bytes $010f $0110 identifier filter 16 bytes $011f $0120 reserved 29 bytes $013c $013d port can registers 3 bytes $013f $0140 receive buffer $014f $0150 transmit buffer 0 $015f $0160 transmit buffer 1 $016f $0170 transmit buffer 2 $017f
mscan controller programmer ? s model of message storage 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 299 17.12.1 message buffer outline figure 17-11 shows the common 13 byte data structure of receive and transmit buffers for extended identifiers. the mapping of standard identifiers into the idr registers is shown in figure 17-12 . all bits of the 13 byte data structure are undefined out of reset. note: the foreground receive buffer can be read anytime but cannot be written. the transmit buffers can be read or written anytime. figure 17-10. message buffer organization address (1) 1. x is 4, 5, 6, or 7 depending on which buffer rxfg, tx0, tx1, or tx2 respectively. register name 01x0 identifier register 0 01x1 identifier register 1 01x2 identifier register 2 01x3 identifier register 3 01x4 data segment register 0 01x5 data segment register 1 01x6 data segment register 2 01x7 data segment register 3 01x8 data segment register 4 01x9 data segment register 5 01xa data segment register 6 01xb data segment register 7 01xc data length register 01xd transmit buffer priority register (2) 2. not applicable for receive buffers 01xe unused 01xf unused
mscan controller advance information 68hc(9)12d60 ? rev 3.0 300 mscan controller motorola figure 17-11. receive/transmit message buffer extended identifier addr (1) registerr/wbit 7654321bit 0 $01x0 idr0 r id28 id27 id26 id25 id24 id23 id22 id21 w $01x1 idr1 r id20 id19 id18 srr (1) ide (1) id17 id16 id15 w $01x2 idr2 r id14 id13 id12 id11 id10 id9 id8 id7 w $01x3 idr3 r id6 id5 id4 id3 id2 id1 id0 rtr w $01x4 dsr0 r db7 db6 db5 db4 db3 db2 db1 db0 w $01x5 dsr1 r db7 db6 db5 db4 db3 db2 db1 db0 w $01x6 dsr2 r db7 db6 db5 db4 db3 db2 db1 db0 w $01x7 dsr3 r db7 db6 db5 db4 db3 db2 db1 db0 w $01x8 dsr4 r db7 db6 db5 db4 db3 db2 db1 db0 w $01x9 dsr5 r db7 db6 db5 db4 db3 db2 db1 db0 w $01xa dsr6 r db7 db6 db5 db4 db3 db2 db1 db0 w $01xb dsr7 r db7 db6 db5 db4 db3 db2 db1 db0 w $01xc dlr r dlc3 dlc2 dlc1 dlc0 w 1. x is 4, 5, 6, or 7 depending on which buffer rxfg, tx0, tx1, or tx2 respectively.
mscan controller programmer ? s model of message storage 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 301 17.12.2 identifier registers (idrn) the identifiers consist of either 11 bits (id10 ? id0) for the standard, or 29 bits (id28 ? id0) for the extended format. id10/28 is the most significant bit and is transmitted first on the bus during the arbitration procedure. the priority of an identifier is defined to be highest for the smallest binary number. srr ? substitute remote request this fixed recessive bit is used only in extended format. it must be set to 1 by the user for transmission buffers and will be stored as received on the can bus for receive buffers. ide ? id extended this flag indicates whether the extended or standard identifier format is applied in this buffer. in the case of a receive buffer the flag is set as being received and indicates to the cpu how to process the buffer identifier registers. in the case of a transmit buffer the flag indicates to the mscan12 what type of identifier to send. 0 = standard format (11-bit) 1 = extended format (29-bit) figure 17-12. standard identifier mapping addr (1) registerr/wbit 7654321bit 0 $01x0 idr0 r id10 id9 id8 id7 id6 id5 id4 id3 w $01x1 idr1 r id2 id1 id0 rtr ide(0) w $01x2 idr2 r w $01x3 idr3 r w 1. x is 4, 5, 6, or 7 depending on which buffer rxfg, tx0, tx1, or tx2 respectively.
mscan controller advance information 68hc(9)12d60 ? rev 3.0 302 mscan controller motorola rtr ? remote transmission request this flag reflects the status of the remote transmission request bit in the can frame. in the case of a receive buffer it indicates the status of the received frame and supports the transmission of an answering frame in software. in the case of a transmit buffer this flag defines the setting of the rtr bit to be sent. 0 = data frame 1 = remote frame 17.12.3 data length register (dlr) this register keeps the data length field of the can frame. dlc3 ? dlc0 ? data length code bits the data length code contains the number of bytes (data byte count) of the respective message. at the transmission of a remote frame, the data length code is transmitted as programmed while the number of transmitted data bytes is always 0. the data byte count ranges from 0 to 8 for a data frame. table 17-4 shows the effect of setting the dlc bits. table 17-4. data length codes data length code data byte count dlc3 dlc2 dlc1 dlc0 00000 00011 00102 00113 01004 01015 01106 01117 10008
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 303 17.12.4 data segment registers (dsrn) the eight data segment registers contain the data to be transmitted or being received. the number of bytes to be transmitted or being received is determined by the data length code in the corresponding dlr. 17.12.5 transmit buffer priority registers (tbpr) prio7 ? prio0 ? local priority this field defines the local priority of the associated message buffer. the local priority is used for the internal prioritisation process of the mscan12 and is defined to be highest for the smallest binary number. the mscan12 implements the following internal prioritisation mechanism:  all transmission buffers with a cleared txe flag participate in the prioritisation immediately before the sof (start of frame) is sent.  the transmission buffer with the lowest local priority field wins the prioritisation.  in cases of more than one buffer having the same lowest priority, the message buffer with the lower index number wins. 17.13 programmer ? s model of control registers 17.13.1 overview the programmer ? s model has been laid out for maximum simplicity and efficiency. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tbpr (1) 1. x is 5, 6, or 7 depending on which buffer tx0, tx1, or tx2 respectively. r prio7 prio6 prio5 prio4 prio3 prio2 prio1 prio0 $01xd w reset ????????
mscan controller advance information 68hc(9)12d60 ? rev 3.0 304 mscan controller motorola 17.13.2 mscan12 module control register 0 (cmcr0) cswai ? can stops in wait mode 0 = the module is not affected during wait mode. 1 = the module ceases to be clocked during wait mode. synch ? synchronized status this bit indicates whether the mscan12 is synchronized to the can bus and as such can participate in the communication process. 0 = mscan12 is not synchronized to the can bus 1 = mscan12 is synchronized to the can bus tlnken ? timer enable this flag is used to establish a link between the mscan12 and the on- chip timer (see timer link ). 0 = the port is connected to the timer input. 1 = the mscan12 timer signal output is connected to the timer input. slpak ? sleep mode acknowledge this flag indicates whether the mscan12 is in module internal sleep mode. it shall be used as a handshake for the sleep mode request (see mscan12 sleep mode ). 0 = wake-up ? the mscan12 is not in sleep mode. 1 = sleep ? the mscan12 is in sleep mode. slprq ? sleep request this flag allows to request the mscan12 to go into an internal power- saving mode (see mscan12 sleep mode ). 0 = wake-up ? the mscan12 will function normally. 1 = sleep request ? the mscan12 will go into sleep mode when the can bus is idle, i.e. the module is not receiving a message and all transmit buffers are empty. bit 7654321bit 0 cmcr0 r 0 0 cswai synch tlnken slpak slprq sftres $0100 w reset 0 0100001
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 305 sftres ? soft_reset when this bit is set by the cpu, the mscan12 immediately enters the soft_reset state. any ongoing transmission or reception is aborted and synchronisation to the bus is lost. the following registers will go into and stay in the same state as out of hard reset: cmcr0, crflg, crier, ctflg, ctcr. the registers cmcr1, cbtr0, cbtr1, cidac, cidar0 ? 3, cidmr0 ? 3 can only be written by the cpu when the mscan12 is in soft_reset state. the values of the error counters are not affected by soft_reset. when this bit is cleared by the cpu, the mscan12 will try to synchronize to the can bus: if the mscan12 is not in busoff state it will be synchronized after 11 recessive bits on the bus; if the mscan12 is in busoff state it continues to wait for 128 occurrences of 11 recessive bits. clearing sftres and writing to other bits in cmcr0 must be in separate instructions. 0 = normal operation 1 = mscan12 in soft_reset state. 17.13.3 mscan12 module control register 1 (cmcr1). loopb ? loop back self test mode when this bit is set the mscan12 performs an internal loop back which can be used for self test operation: the bit stream output of the transmitter is fed back to the receiver internally. the rxcan input pin is ignored and the txcan output goes to the recessive state (1). the mscan12 behaves as it does normally when transmitting and treats its own transmitted message as a message received from a remote bit 76 5 4 3 2 1bit 0 cmcr1r00000 loopb wupm clksrc $0101 w reset 0 0 0 0 0 0 0 0
mscan controller advance information 68hc(9)12d60 ? rev 3.0 306 mscan controller motorola node. in this state the mscan12 ignores the bit sent during the ack slot of the can frame acknowledge field to insure proper reception of its own message. both transmit and receive interrupts are generated. 0 = normal operation 1 = activate loop back self test mode wupm ? wake-up mode this flag defines whether the integrated low-pass filter is applied to protect the mscan12 from spurious wake-ups (see programmable wake-up function ). 0 = mscan12 will wake up the cpu after any recessive to dominant edge on the can bus. 1 = mscan12 will wake up the cpu only in the case of dominant pulse on the bus which has a length of at least approximately t wup . clksrc ? mscan12 clock source this flag defines which clock source the mscan12 module is driven from (only for system with cgm module; see clock system , figure 17-7 ). 0 = the mscan12 clock source is extali. 1 = the mscan12 clock source is sysclk, twice the frequency of eclk. note: the cmcr1 register can be written only if the sftres bit in cmcr0 is set.
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 307 17.13.4 mscan12 bus timing register 0 (cbtr0) sjw1, sjw0 ? synchronization jump width the synchronization jump width defines the maximum number of time quanta (tq) clock cycles by which a bit may be shortened, or lengthened, to achieve resynchronization on data transitions on the bus (see table 17-5 ). brp5 ? brp0 ? baud rate prescaler these bits determine the time quanta (tq) clock, which is used to build up the individual bit timing, according to table 17-6 . note: the cbtr0 register can only be written if the sftres bit in cmcr0 is set. bit 7654321bit 0 cbtr0 r sjw1 sjw0 brp5 brp4 brp3 brp2 brp1 brp0 $0102 w reset 0 0 0 0 0 0 0 0 table 17-5. synchronization jump width sjw1 sjw0 synchronization jump width 0 0 1 tq clock cycle 0 1 2 tq clock cycles 1 0 3 tq clock cycles 1 1 4 tq clock cycles table 17-6. baud rate prescaler brp5 brp4 brp3 brp2 brp1 brp0 prescaler value (p) 000000 1 000001 2 000010 3 000011 4 :::::: : :::::: : 111111 64
mscan controller advance information 68hc(9)12d60 ? rev 3.0 308 mscan controller motorola 17.13.5 mscan12 bus timing register 1 (cbtr1). samp ? sampling this bit determines the number of samples of the serial bus to be taken per bit time. if set three samples per bit are taken, the regular one (sample point) and two preceding samples, using a majority rule. for higher bit rates samp should be cleared, which means that only one sample will be taken per bit. 0 = one sample per bit. 1 = three samples per bit. (1) tseg22 ? tseg10 ? time segment time segments within the bit time fix the number of clock cycles per bit time, and the location of the sample point. (see figure 17-8 ) time segment 1 (tseg1) and time segment 2 (tseg2) are programmable as shown in table 17-8 . bit 7654321bit 0 cbtr1 r samp tseg22 tseg21 tseg20 tseg13 tseg12 tseg11 tseg10 $0103 w reset 00000000 1. in this case, phase_seg1 must be at least two time quanta. table 17-7. time segment syntax sync_seg system expects transitions to occur on the bus during this period. transmit point a node in transmit mode will transfer a new value to the can bus at this point. sample point a node in receive mode will sample the bus at this point. if the three samples per bit option is selected then this point marks the position of the third sample.
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 309 the bit time is determined by the oscillator frequency, the baud rate prescaler, and the number of time quanta (tq) clock cycles per bit (as shown above). note: the cbtr1 register can only be written if the sftres bit in cmcr0 is set 17.13.6 mscan12 receiver flag register (crflg) all bits of this register are read and clear only. a flag can be cleared by writing a 1 to the corresponding bit position. a flag can only be cleared when the condition which caused the setting is no more valid. writing a 0 has no effect on the flag setting. every flag has an associated interrupt enable flag in the crier register. a hard or soft reset clears the register. wupif ? wake-up interrupt flag if the mscan12 detects bus activity while in sleep mode, it sets the wupif flag. if not masked, a wake-up interrupt is pending while this flag is set. 0 = no wake-up activity has been observed while in sleep mode. 1 = mscan12 has detected activity on the bus and requested wake-up. table 17-8. time segment values tseg13 tseg12 tseg11 tseg10 time segment 1 tseg22 tseg21 tseg20 time segment 2 0 0 0 0 1 tq clock cycle 0 0 0 1 tq clock cycle 0 0 0 1 2 tq clock cycles 0 0 1 2 tq clock cycles 0 0 1 0 3 tq clock cycles . . . . 0 0 1 1 4 tq clock cycles . . . . . . . . . 1 1 1 8 tq clock cycles .... . 1 1 1 1 16 tq clock cycles bittime presc value ? f cgmcanclk ------------------------------------------ - number ? of timequanta tt = bit 76 5 4 3 2 1bit 0 crflg r wupif rwrnif twrnif rerrif terrif boffif ovrif rxf $0104 w reset 0 0 0 0 0 0 0 0
mscan controller advance information 68hc(9)12d60 ? rev 3.0 310 mscan controller motorola rwrnif ? receiver warning interrupt flag this flag is set when the mscan12 goes into warning status due to the receive error counter (rec) exceeding 96 and neither one of the error interrupt flags or the bus-off interrupt flag is set (1) . if not masked, an error interrupt is pending while this flag is set. 0 = no receiver warning status has been reached. 1 = mscan12 went into receiver warning status. twrnif ? transmitter warning interrupt flag this bit will be set when the mscan12 goes into warning status due to the transmit error counter (tec) exceeding 96 and neither one of the error interrupt flags or the bus-off interrupt flag is set (2) . if not masked, an error interrupt is pending while this flag is set. 0 = no transmitter warning status has been reached. 1 = mscan12 went into transmitter warning status. rerrif ? receiver error passive interrupt flag this flag is set when the mscan12 goes into error passive status due to the receive error counter (rec) exceeding 127 and the bus-off interrupt flag is not set (3) . if not masked, an error interrupt is pending while this flag is set. 0 = no receiver error passive status has been reached. 1 = mscan12 went into receiver error passive status. terrif ? transmitter error passive interrupt flag this flag is set when the mscan12 goes into error passive status due to the transmit error counter (tec) exceeding 127 and the bus-off interrupt flag is not set (4) . if not masked, an error interrupt is pending while this flag is set. 0 = no transmitter error passive status has been reached. 1 = mscan12 went into transmitter error passive status. 1. condition to set the flag: rwrnif = (96 rec 127) & rerrif & terrif & boffif 2. condition to set the flag: twrnif = (96 tec 127) & rerrif & terrif & boffif 3. condition to set the flag: rerrif = (128 rec 255) & boffif 4. condition to set the flag: terrif = (128 tec 255) & boffif
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 311 boffif ? busoff interrupt flag this flag is set when the mscan12 goes into busoff status, due to the transmit error counter exceeding 255. it cannot be cleared before the mscan12 has monitored 128 times 11 consecutive recessive bits on the bus. if not masked, an error interrupt is pending while this flag is set. 0 = no busoff status has been reached. 1 = mscan12 went into busoff status. ovrif ? overrun interrupt flag this flag is set when a data overrun condition occurrs. if not masked, an error interrupt is pending while this flag is set. 0 = no data overrun has occurred. 1 = a data overrun has been detected. rxf ? receive buffer full the rxf flag is set by the mscan12 when a new message is available in the foreground receive buffer. this flag indicates whether the buffer is loaded with a correctly received message. after the cpu has read that message from the receive buffer, the rxf flag must be handshaken (cleared) in order to release the buffer. a set rxf flag prohibits the exchange of the background receive buffer into the foreground buffer. if not masked, a receive interrupt is pending while this flag is set. 0 = the receive buffer is released (not full). 1 = the receive buffer is full. a new message is available. warning: to ensure data integrity, no registers of the receive buffer shall be read while the rxf flag is cleared. note: the crflg register is held in the reset state when the sftres bit in cmcr0 is set.
mscan controller advance information 68hc(9)12d60 ? rev 3.0 312 mscan controller motorola 17.13.7 mscan12 receiver interrupt enable register (crier) wupie ? wake-up interrupt enable 0 = no interrupt is generated from this event. 1 = a wake-up event results in a wake-up interrupt. rwrnie ? receiver warning interrupt enable 0 = no interrupt is generated from this event. 1 = a receiver warning status event results in an error interrupt. twrnie ? transmitter warning interrupt enable 0 = no interrupt is generated from this event. 1 = a transmitter warning status event results in an error interrupt. rerrie ? receiver error passive interrupt enable 0 = no interrupt is generated from this event. 1 = a receiver error passive status event results in an error interrupt. terrie ? transmitter error passive interrupt enable 0 = no interrupt is generated from this event. 1 = a transmitter error passive status event results in an error interrupt. boffie ? busoff interrupt enable 0 = no interrupt is generated from this event. 1 = a busoff event results in an error interrupt. ovrie ? overrun interrupt enable 0 = no interrupt is generated from this event. 1 = an overrun event results in an error interrupt. bit 76 5 4 3 2 1bit 0 crier r wupie rwrnie twrnie rerrie terrie boffie ovrie rxfie $0105 w reset 0 0 0 0 0 0 0 0
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 313 rxfie ? receiver full interrupt enable 0 = no interrupt is generated from this event. 1 = a receive buffer full (successful message reception) event results in a receive interrupt. note: the crier register is held in the reset state when the sftres bit in cmcr0 is set. 17.13.8 mscan12 transmitter flag register (ctflg) the abort acknowledge flags are read only. the transmitter buffer empty flags are read and clear only. a flag can be cleared by writing a 1 to the corresponding bit position. writing a zero has no effect on the flag setting. the transmitter buffer empty flags each have an associated interrupt enable bit in the ctcr register. a hard or soft reset resets the register. abtak2 ? abtak0 ? abort acknowledge this flag acknowledges that a message has been aborted due to a pending abort request from the cpu. after a particular message buffer has been flagged empty, this flag can be used by the application software to identify whether the message has been aborted successfully or has been sent in the meantime. the abtakx flag is cleared implicitly whenever the corresponding txe flag is cleared. 0 = the massage has not been aborted, thus has been sent out. 1 = the message has been aborted. txe2 ? txe0 ? transmitter buffer empty this flag indicates that the associated transmit message buffer is empty, thus not scheduled for transmission. the cpu must handshake (clear) the flag after a message has been set up in the transmit buffer and is due for transmission. the mscan12 sets the flag after the message has been bit 7654321bit 0 ctflg r 0 abtak2 abtak1 abtak0 0 txe2 txe1 txe0 $0106 w reset 0 0000111
mscan controller advance information 68hc(9)12d60 ? rev 3.0 314 mscan controller motorola sent successfully. the flag is also set by the mscan12 when the transmission request was successfully aborted due to a pending abort request ( mscan12 transmitter control register (ctcr) ). if not masked, a transmit interrupt is pending while this flag is set. clearing a txex flag also clears the corresponding abtakx flag (see above). when a txex flag is set, the corresponding abtrqx bit is cleared (see mscan12 transmitter control register (ctcr) ). 0 = the associated message buffer is full (loaded with a message due for transmission). 1 = the associated message buffer is empty (not scheduled). warning: to ensure data integrity, no registers of the transmit buffers should be written to while the associated txe flag is cleared. note: the ctflg register is held in the reset state if the sftres bit cmcr0 is set. 17.13.9 mscan12 transmitter control register (ctcr) abtrq2 ? abtrq0 ? abort request the cpu sets an abtrqx bit to request that a scheduled message buffer (txex = 0) shall be aborted. the mscan12 grants the request if the message has not already started transmission, or if the transmission is not successful (lost arbitration or error). when a message is aborted the associated txe and the abort acknowledge flag (abtak, see mscan12 transmitter flag register (ctflg) ) are set and an txe interrupt is generated if enabled. the cpu cannot reset abtrqx. abtrqx is cleared implicitly whenever the associated txe flag is set. 0 = no abort request. 1 = abort request pending. bit 7654321bit 0 ctcr r 0 abtrq2 abtrq1 abtrq0 0 txeie2 txeie1 txeie0 $0107 w reset 00000000
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 315 note: the software must not clear one or more of the txe flags in ctfgl and simultaneously set the respective abtrq bit(s). txeie2 ? txeie0 ? transmitter empty interrupt enable 0 = no interrupt will be generated from this event. 1 = a transmitter empty (transmit buffer available for transmission) event will result in a transmitter empty interrupt. note: the ctcr register is held in the reset state when the sftres bit in cmcr0 is set. 17.13.10 mscan12 identifier acceptance control register (cidac) idam1 ? idam0 ? identifier acceptance mode the cpu sets these flags to define the identifier acceptance filter organisation (see identifier acceptance filter ). table 17-8 summarizes the different settings. in filter closed mode no messages are accepted such that the foreground buffer is never reloaded. bit 7654321bit 0 cidac r 0 0 idam1 idam0 0 idhit2 idhit1 idhit0 $0108 w reset 0 0000000 table 17-9. identifier acceptance mode settings idam1 idam0 identifier acceptance mode 0 0 two 32 bit acceptance filters 0 1 four 16 bit acceptance filters 1 0 eight 8 bit acceptance filters 1 1 filter closed
mscan controller advance information 68hc(9)12d60 ? rev 3.0 316 mscan controller motorola idhit2 ? idhit0 ? identifier acceptance hit indicator the mscan12 sets these flags to indicate an identifier acceptance hit (see identifier acceptance filter ). table 17-8 summarizes the different settings. the idhit indicators are always related to the message in the foreground buffer. when a message gets copied from the background to the foreground buffer the indicators are updated as well. note: the cidac register can only be written if the sftres bit in cmcr0 is set. 17.13.11 mscan12 receive error counter (crxerr) this register reflects the status of the mscan12 receive error counter. the register is read only. table 17-10i. dentifier acceptance hit indication idhit2 idhit1 idhit0 identifier acceptance hit 000 filter 0 hit 001 filter 1 hit 010 filter 2 hit 011 filter 3 hit 100 filter 4 hit 101 filter 5 hit 110 filter 6 hit 111 filter 7 hit bit 7654321bit 0 crxerr r rxerr7 rxerr6 rxerr5 rxerr4 rxerr3 rxerr2 rxerr1 rxerr0 $010e w reset 00000000
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 317 17.13.12 mscan12 transmit error counter (ctxerr) this register reflects the status of the mscan12 transmit error counter. the register is read only. note: both error counters must only be read when in sleep or soft_reset mode. 17.13.13 mscan12 identifier acceptance registers (cidar0 ? 7) on reception each message is written into the background receive buffer. the cpu is only signalled to read the message however, if it passes the criteria in the identifier acceptance and identifier mask registers (accepted); otherwise, the message is overwritten by the next message (dropped). the acceptance registers of the mscan12 are applied on the idr0 to idr3 registers of incoming messages in a bit by bit manner. for extended identifiers all four acceptance and mask registers are applied. for standard identifiers only the first two (cidmr0/1 and cidar0/1) are applied. bit 76 5 4 3 2 1bit 0 ctxerr r txerr7 txerr6 txerr5 txerr4 txerr3 txerr2 txerr1 txerr0 $010f w reset 0 0 0 0 0 0 0 0
mscan controller advance information 68hc(9)12d60 ? rev 3.0 318 mscan controller motorola ac7 ? ac0 ? acceptance code bits ac7 ? ac0 comprise a user defined sequence of bits with which the corresponding bits of the related identifier register (idrn) of the receive message buffer are compared. the result of this comparison is then masked with the corresponding identifier mask register. note: the cidar0 ? 7 registers can only be written if the sftres bit in cmcr0 is set. bit 7654321bit 0 cidar0 r ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 $0110 w cidar1 r ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 $0111 w cidar2 r ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 $0112 w cidar3 r ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 $0113 w reset ???????? bit 7654321bit 0 cidar4 r ac7ac6ac5ac4ac3ac2ac1ac0 $0118 w cidar5 r ac7ac6ac5ac4ac3ac2ac1ac0 $0119 w cidar6 r ac7ac6ac5ac4ac3ac2ac1ac0 $011a w cidar7 r ac7ac6ac5ac4ac3ac2ac1ac0 $011b w reset ????????
mscan controller programmer ? s model of control registers 68hc(9)12d60 ? rev 3.0 advance information motorola mscan controller 319 17.13.14 mscan12 identifier mask registers (cidmr0 ? 7) the identifier mask register specifies which of the corresponding bits in the identifier acceptance register are relevant for acceptance filtering. to receive standard identifiers in 32 bit filter mode it is required to program the last three bits (am2 ? am0) in the mask registers cidmr1 and cidmr5 to ? don ? t care ? . to receive standard identifiers in 16 bit filter mode it is required to program the last three bits (am2 ? am0) in the mask registers cidmr1, cidmr3, cidmr5 and cidmr7 to ? don ? t care ? . bit 7654321bit 0 cidmr0 r am7 am6 am5 am4 am3 am2 am1 am0 $0114 w cidmr1 r am7 am6 am5 am4 am3 am2 am1 am0 $0115 w cidmr2 r am7 am6 am5 am4 am3 am2 am1 am0 $0116 w cidmr3 r am7 am6 am5 am4 am3 am2 am1 am0 $0117 w reset ???????? bit 7654321bit 0 cidmr4 r am7 am6 am5 am4 am3 am2 am1 am0 $011c w cidmr5 r am7 am6 am5 am4 am3 am2 am1 am0 $011d w cidmr6 r am7 am6 am5 am4 am3 am2 am1 am0 $011e w cidmr7 r am7 am6 am5 am4 am3 am2 am1 am0 $011f w reset ????????
mscan controller advance information 68hc(9)12d60 ? rev 3.0 320 mscan controller motorola am7 ? am0 ? acceptance mask bits if a particular bit in this register is cleared this indicates that the corresponding bit in the identifier acceptance register must be the same as its identifier bit, before a match is detected. the messageis accepted if all such bits match. if a bit is set, it indicates that the state of the corresponding bit in the identifier acceptance register does not affect whether or not the message is accepted. bit description: 0 = match corresponding acceptance code register and identifier bits. 1 = ignore corresponding acceptance code register bit. note: the cidmr0 ? 7 registers can only be written if the sftres bit in cmcr0 is set. 17.13.15 mscan12 port can control register (pctlcan) the following bits control pins 7 through 2 of port can. pins 1 and 0 are reserved for the rxcan (input only) and txcan (output only) pins. pupcan ? pull-up enable port can 0 = pull mode disabled for port can. 1 = pull mode enabled for port can. in 80qfp all portcan[2:7] pins should either be defined as outputs or have their pull-ups enabled. rdpcan ? reduced drive port can 0 = reduced drive disabled for port can. 1 = reduced drive enabled for port can. bit 7654321bit 0 pctlcanr000000 pupcan rdpcan $013d w reset 0 0000000
mscan controller advance information 68hc(9)12d60 ? rev 3.0 321 mscan controller motorola 17.13.16 mscan12 port can data register (portcan) pcan7 ? pcan2 ? port can data bits (not available in 80qfp) writing to pcanx stores the bit value in an internal bit memory. this value is driven to the respective pin only if ddcanx = 1. reading pcanx returns  the value of the internal bit memory driven to the pin, if ddcanx = 1  the value of the respective pin, if ddcanx = 0 reading bits 1 and 0 returns the value of the txcan and rxcan pins, respectively. 17.13.17 mscan12 port can data direction register (ddrcan) ddrcan register determines the primary direction for the port can pins which are available as general purpose i/o. the value in the ddrcan also affects the source of data for reads of the corresponding port can register. when the ddcanx = 0 (input), the pin is read. when the ddcanx =1 (output), the internal bit memory is read. ddcan7 ? ddcan2 ? data direction port can bits 0 = respective i/o pin is configured for input. 1 = respective i/o pin is configured for output. bit 7654321bit 0 portcan r pcan7 pcan6 pcan5 pcan4 pcan3 pcan2 txcan rxcan $013e w reset 0 0000000 bit 7654321bit 0 ddrcan r ddcan7 ddcan6 ddcan5 ddcan4 ddcan3 ddcan2 00 $013f w reset 0 0000000
mscan controller advance information 68hc(9)12d60 ? rev 3.0 322 mscan controller motorola
68hc(9)12d60 ? rev 3.0 advance information motorola analog-to-digital converter 323 advance information ? 68hc(9)12d60 section 18. analog-to-digital converter 18.1 contents 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 18.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 18.4 atd registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 18.5 atd mode operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 18.2 introduction the 112tqfp version of the 68hc(9)12d60 has two identical atd modules identified as atd0 and atd1. except for the v dda and v ssa analog supply voltage, all pins are duplicated and indexed with ? 0 ? or ? 1 ? in the following description. an ? x ? indicates either ? 0 ? or ? 1 ? . the 80qfp version has only one atd available, atd0. atd1 is not bonded out. as this module defaults to disabled on reset and it's i/o are inputs by default it requires no configuration. the atd module is an 8-channel, 10-bit or 8-bit, multiplexed-input successive-approximation analog-to-digital converter. it does not require external sample and hold circuits because of the type of charge redistribution technique used. the atd converter timing can be synchronized to the system p clock. the atd module consists of a 16- word (32-byte) memory-mapped control register block used for control, testing and configuration.
analog-to-digital converter advance information 68hc(9)12d60 ? rev 3.0 324 analog-to-digital converter motorola figure 18-1. analog-to-digital converter block diagram 18.3 functional description a single conversion sequence consists of four or eight conversions, depending on the state of the select 8 channel mode (s8cm) bit when atdxctl5 is written. there are eight basic conversion modes. in the non-scan modes, the scf bit is set after the sequence of four or eight conversions has been performed and the atd module halts. in the scan modes, the scf bit is set after the first sequence of four or eight conversions has been performed, and the atd module continues to restart the sequence. in both modes, the ccf bit associated with each register is set when that register is loaded with the appropriate conversion result. that flag is cleared automatically when that result register is read. the conversions are started by writing to the control registers. mode and timing controls atd 0 atd 1 atd 2 atd 3 atd 4 atd 5 atd 6 atd 7 sar rc dac array and comparator internal bus v dda v ssa v rlx v rhx clock select/prescale analog mux and sample buffer amp port ad data input register anx7/padx7 anx6/padx6 anx5/padx5 anx4/padx4 anx3/padx3 anx2/padx2 anx1/padx1 anx0/padx0 reference supply
analog-to-digital converter atd registers 68hc(9)12d60 ? rev 3.0 advance information motorola analog-to-digital converter 325 18.4 atd registers control and data registers for the atd modules are described below. both atds have identical control registers mapped in two blocks of 16 bytes. writes to this register will abort current conversion sequence. read: any time write: any time. write: write to this register has no meaning read: special mode only bit 7654321bit 0 reset:00000000 atd0ctl0/atd1ctl0 ? reserved $0060/$01e0 bit 7654321bit 0 reset: 0 0 000000 atd0ctl1/atd1ctl1 ? reserved $0061/$01e1
analog-to-digital converter advance information 68hc(9)12d60 ? rev 3.0 326 analog-to-digital converter motorola the atd control register 2 and 3 are used to select the power up mode, interrupt control, and freeze control. writes to these registers abort any current conversion sequence. read or write anytime except ascif bit, which cannot be written. bit positions atdctl2[4:2] and atdctl3[7:2] are unused and always read as zeros. adpu ? atd disable 0 = disables the atd, including the analog section for reduction in power consumption. 1 = allows the atd to function normally. software can disable the clock signal to the a/d converter and power down the analog circuits to reduce power consumption. when reset to zero, the adpu bit aborts any conversion sequence in progress. because the bias currents to the analog circuits are turned off, the atd requires a period of recovery time to stabilize the analog circuits after setting the adpu bit. affc ? atd fast flag clear all 0 = atd flag clearing operates normally (read the status register before reading the result register to clear the associated ccf bit). 1 = changes all atd conversion complete flags to a fast clear sequence. any access to a result register (atd0 ? 7) will cause the associated ccf flag to clear automatically if it was set at the time. awai ? atd wait mode 0 = atd continues to run when the mcu is in wait mode 1 = atd stops to save power when the mcu is in wait mode bit 7654321bit 0 adpu affc awai 0 0 0 ascie ascif reset: 0 0 0 0 0 0 0 0 atd0ctl2/atd1ctl2 ? atd control register 2 $0062/$01e2
analog-to-digital converter atd registers 68hc(9)12d60 ? rev 3.0 advance information motorola analog-to-digital converter 327 when the awai bit is set and the module enters wait mode, most of the clocks stop and the analog portion powers down. when the module comes out of wait, it is recommended that a stabilisation delay (stop and atd power up recovery time, t sr ) is allowed before new conversions are started. additionally, the atd does not re-initialise automatically on leaving wait mode. ascie ? atd sequence complete interrupt enable 0 = disables atd interrupt 1 = enables atd interrupt on sequence complete ascif ? atd sequence complete interrupt flag cannot be written in any mode. 0 = no atd interrupt occurred 1 = atd sequence complete frz1, frz0 ? background debug (freeze) enable (suspend module operation at breakpoint) when debugging an application, it is useful in many cases to have the atd pause when a breakpoint is encountered. these two bits determine how the atd will respond when background debug mode becomes active. bit 7654321bit 0 000000frz1frz0 reset: 0 0 0 0 0 0 0 0 atd0ctl3/atd1ctl3 ? atd control register 3 $0063/$01e3 table 18-1. atd response to background debug enable frz1 frz0 atd response 0 0 continue conversions in active background mode 01 reserved 1 0 finish current conversion, then freeze 1 1 freeze when bdm is active
analog-to-digital converter advance information 68hc(9)12d60 ? rev 3.0 328 analog-to-digital converter motorola the atd control register 4 is used to select the clock source and set up the prescaler. writes to the atd control registers initiate a new conversion sequence. if a write occurs while a conversion is in progress, the conversion is aborted and atd activity halts until a write to atdxctl5 occurs. s10bm ? 10 bit mode 0 = 8 bit operation 1 = 10 bit operation smp1, smp0 ? select sample time used to select one of four sample times after the buffered sample and transfer has occurred. bit 7654321bit 0 s10bm smp1 smp0 prs4 prs3 prs2 prs1 prs0 reset: 0 0 0 0 0 0 0 1 atd0ctl4/atd1ctl4 ? atd control register 4 $0064/$01e4 table 18-2. final sample time selection smp1 smp0 final sample time 0 0 2 a/d clock periods 0 1 4 a/d clock periods 1 0 8 a/d clock periods 1 1 16 a/d clock periods
analog-to-digital converter atd registers 68hc(9)12d60 ? rev 3.0 advance information motorola analog-to-digital converter 329 prs4, prs3, prs2, prs1, prs0 ? select divide-by factor for atd p-clock prescaler. the binary value written to these bits (1 to 31) selects the divide-by factor for the modulo counter-based prescaler. the p clock is divided by this value plus one and then fed into a 2 circuit to generate the atd module clock. the divide-by-two circuit insures symmetry of the output clock signal. clearing these bits causes the prescale value default to one which results in a 2 prescale factor. this signal is then fed into the 2 logic. the reset state divides the p clock by a total of four and is appropriate for nominal operation at 2 mhz. table 18-3 shows the divide-by operation and the appropriate range of system clock frequencies. table 18-3. clock prescaler values prescale value total divisor max p clock (1) 1. maximum conversion frequency is 2 mhz. maximum p clock divisor value will become maximum conversion rate that can be used on this atd module. min p clock (2) 2. minimum conversion frequency is 500 khz. minimum p clock divisor value will become minimum conversion rate that this atd can perform. 00000 24 mhz 1 mhz 00001 48 mhz 2 mhz 00010 68 mhz 3 mhz 00011 88 mhz 4 mhz 00100 10 8 mhz 5 mhz 00101 12 8 mhz 6 mhz 00110 14 8 mhz 7 mhz 00111 16 8 mhz 8 mhz 01xxx do not use 1xxxx
analog-to-digital converter advance information 68hc(9)12d60 ? rev 3.0 330 analog-to-digital converter motorola the atd control register 5 is used to select the conversion modes, the conversion channel(s), and initiate conversions. read or write any time. writes to the atd control registers initiate a new conversion sequence. if a conversion sequence is in progress when a write occurs, that sequence is aborted and the scf and ccf bits are reset. s8cm ? select 8 channel mode 0 = conversion sequence consists of four conversions 1 = conversion sequence consists of eight conversions scan ? enable continuous channel scan 0 = single conversion sequence 1 = continuous conversion sequences (scan mode) when a conversion sequence is initiated by a write to the atdxctl register, the user has a choice of performing a sequence of four (or eight, depending on the s8cm bit) conversions or continuously performing four (or eight) conversion sequences. mult ? enable multichannel conversion 0 = atd sequencer runs all four or eight conversions on a single input channel selected via the cd, cc, cb, and ca bits. 1 = atd sequencer runs each of the four or eight conversions on sequential channels in a specific group. refer to table 18-4 . bit 7654321bit 0 0 s8cm scan mult cd cc cb ca reset: 0 0 000000 atd0ctl5/atd1ctl5 ? atd control register 5 $0065/$01e5
analog-to-digital converter atd registers 68hc(9)12d60 ? rev 3.0 advance information motorola analog-to-digital converter 331 cd, cc, cb, and ca ? channel select for conversion table 18-4. multichannel mode result register assignment s8cm cd cc cb ca channel signal result in adrxx if mult = 1 000 0 0 an0 adrx0 0 1 an1 adrx1 1 0 an2 adrx2 1 1 an3 adrx3 001 0 0 an4 adrx0 0 1 an5 adrx1 1 0 an6 adrx2 1 1 an7 adrx3 010 0 0 reserved adrx0 0 1 reserved adrx1 1 0 reserved adrx2 1 1 reserved adrx3 011 0 0 v rh adrx0 0 1 v rl adrx1 1 0 (v rh + v rl )/2 adrx2 1 1 test/reserved adrx3 10 0 0 0 an0 adrx0 0 0 1 an1 adrx1 0 1 0 an2 adrx2 0 1 1 an3 adrx3 1 0 0 an4 adrx4 1 0 1 an5 adrx5 1 1 0 an6 adrx6 1 1 1 an7 adrx7 11 0 0 0 reserved adrx0 0 0 1 reserved adrx1 0 1 0 reserved adrx2 0 1 1 reserved adrx3 1 0 0 v rh adrx4 1 0 1 v rl adrx5 1 1 0 (v rh + v rl )/2 adrx6 1 1 1 test/reserved adrx7 shaded bits are ? don ? t care ? if mult = 1 and the entire block of four or eight channels make up a conversion sequence. when mult = 0, all four bits (cd, cc, cb, and ca) must be specified and a conversion sequence consists of four or eight consecutive conversions of the single specified channel.
analog-to-digital converter advance information 68hc(9)12d60 ? rev 3.0 332 analog-to-digital converter motorola note: conversion of (vrh-vrl)/2 returns $7f, $80 or $81 in 8-bit mode. the atd status registers contain the flags indicating the completion of atd conversions. normally, it is read-only. in special mode, the scf bit and the ccf bits may also be written. scf ? sequence complete flag this bit is set at the end of the conversion sequence when in the single conversion sequence mode (scan = 0 in atdxctl5) and is set at the end of the first conversion sequence when in the continuous conversion mode (scan = 1 in atdxctl5). when affc = 0, scf is cleared when a write is performed to atdxctl5 to initiate a new conversion sequence. when affc = 1, scf is cleared after the first result register is read. cc[2:0] ? conversion counter for current sequence of four or eight conversions this 3-bit value reflects the contents of the conversion counter pointer in a four or eight count sequence. this value also reflects which result register will be written next, indicating which channel is currently being converted. bit 7654321bit 0 scf 0 0 0 0 cc2 cc1 cc0 reset:00000000 atd0stat0/atd1stat0 ? atd status register $0066/$01e6 bit 7654321bit 0 ccf7 ccf6 ccf5 ccf4 ccf3 ccf2 ccf1 ccf0 reset: 00000000 atd0stat1/atd1stat1 ? atd status register $0067/$01e7
analog-to-digital converter atd registers 68hc(9)12d60 ? rev 3.0 advance information motorola analog-to-digital converter 333 ccf[7:0] ? conversion complete flags each of these bits are associated with an individual atd result register. for each register, this bit is set at the end of conversion for the associated atd channel and remains set until that atd result register is read. it is cleared at that time if affc bit is set, regardless of whether a status register read has been performed (i.e., a status register read is not a pre-qualifier for the clearing mechanism when affc = 1). otherwise the status register must be read to clear the flag. the test registers control various special modes which are used during manufacturing. the test register can be read or written only in the special modes. in the normal modes, reads of the test register return zero and writes have no effect. sar[9:0] ? sar data reads of this byte return the current value in the sar. writes to this byte change the sar to the value written. bits sar[9:0] reflect the ten sar bits used during the resolution process for a 10-bit result. bit 7654321bit 0 sar9 sar8 sar7 sar6 sar5 sar4 sar3 sar2 reset: 0 0 000000 atd0testh/atd1testh ? atd test register $0068/$01e8 bit 7654321bit 0 sar1 sar0 rst tstout tst3 tst2 tst1 tst0 reset: 0 0 0 0 0 0 0 0 atd0testl/atd1testl ? atd test register $0069/$01e9
analog-to-digital converter advance information 68hc(9)12d60 ? rev 3.0 334 analog-to-digital converter motorola rst ? module reset bit when set, this bit causes all registers and activity in the module to assume the same state as out of power-on reset (except for adpu bit in atdctl2, which remains set, allowing the atd module to remain enabled). tstout ? multiplex output of tst[3:0] (factory use) tst[3:0] ? test bits 3 to 0 (reserved) selects one of 16 reserved factory testing modes padx[7:0] ? port ad data input bits after reset these bits reflect the state of the input pins. may be used for general-purpose digital input. when the software reads portadx, it obtains the digital levels that appear on the corresponding port ad pins. pins with signals not meeting v il or v ih specifications will have an indeterminate value. writes to this register have no meaning at any time. bit 7654321bit 0 padx7 padx6 padx5 padx4 padx3 padx2 padx1 padx0 reset: 0 0 0 0 0 0 0 0 portad0/portad1 ? port ad data input register $006f/$01ef
analog-to-digital converter atd registers 68hc(9)12d60 ? rev 3.0 advance information motorola analog-to-digital converter 335 adrxxh[7:0] ? atd conversion result (high) the reset condition for these registers is undefined. in 8-bit mode, these registers contain the left-justified, unsigned result from the 8-bit atd conversion. in 10-bit mode these registers contain the high order bits of the conversion result. adrxxl[7:0] ? atd conversion result (low) the reset condition for these registers is undefined. in 8-bit mode, these registers bits are reserved. in 10-bit mode these registers contain the remaining two low order bits of the conversion result in bits 6 and 7. 8-bit mode bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 10-bit mode bit 9bit 8bit 7bit 6bit 5bit 4bit 3bit 2 reset: uuuuuuuu adrx0h ? a/d conversion result register high 0 $0070/$01f0 adrx1h ? a/d conversion result register high 1 $0072/$01f2 adrx2h ? a/d conversion result register high 2 $0074/$01f4 adrx3h ? a/d conversion result register high 3 $0076/$01f6 adrx4h ? a/d conversion result register high 4 $0078/$01f8 adrx5h ? a/d conversion result register high 5 $007a/$01fa adrx6h ? a/d conversion result register high 6 $007c/$01fc adrx7h ? a/d conversion result register high 7 $007e/$01fe 8-bit mode ???????? 10-bit mode bit 1 bit 0 ?????? reset: uuuuuuuu adrx0l ? a/d conversion result register low 0 $0071/$01f1 adrx1l ? a/d conversion result register low 1 $0073/$01f3 adrx2l ? a/d conversion result register low 2 $0075/$01f5 adrx3l ? a/d conversion result register low 3 $0077/$01f7 adrx4l ? a/d conversion result register low 4 $0079/$01f9 adrx5l ? a/d conversion result register low 5 $007b/$01fb adrx6l ? a/d conversion result register low 6 $007d/$01fd adrx7l ? a/d conversion result register low 7 $007f/$01ff
analog-to-digital converter advance information 68hc(9)12d60 ? rev 3.0 336 analog-to-digital converter motorola the channel from which this result was obtained is dependent on the conversion mode selected. the registers are always read-only in normal mode. 18.5 atd mode operation stop ? causes all clocks to halt (if the s bit in the ccr is zero). the system is placed in a minimum-power standby mode. this aborts any conversion sequence in progress. wait ? atd conversion continues unless awai bit in atdxctl2 register is set. bdm ? debug options available as set in register atdxctl3. user ? atd continues running unless adpu is cleared. adpu ? atd operations are stopped if adpu = 0, but registers are accessible.
68hc(9)12d60 ? rev 3.0 advance information motorola development support 337 advance information ? 68hc(9)12d60 section 19. development support 19.1 contents 19.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 19.3 instruction queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 19.4 background debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 19.5 breakpoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 19.6 instruction tagging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 19.2 introduction development support involves complex interactions between 68hc(9)12d60 resources and external development systems. the following section concerns instruction queue and queue tracking signals, background debug mode, and instruction tagging. 19.3 instruction queue the cpu12 instruction queue provides at least three bytes of program information to the cpu when instruction execution begins. the cpu12 always completely finishes executing an instruction before beginning to execute the next instruction. status signals ipipe[1:0] provide information about data movement in the queue and indicate when the cpu begins to execute instructions. this makes it possible to monitor cpu activity on a cycle-by-cycle basis for debugging. information available on the ipipe[1:0] pins is time multiplexed. external circuitry can latch data movement information on rising edges of the e-clock signal; execution start information can be latched on falling edges. table 19-1 shows the meaning of data on the pins.
development support advance information 68hc(9)12d60 ? rev 3.0 338 development support motorola program information is fetched a few cycles before it is used by the cpu. in order to monitor cycle-by-cycle cpu activity, it is necessary to externally reconstruct what is happening in the instruction queue. internally the mcu only needs to buffer the data from program fetches. for system debug it is necessary to keep the data and its associated address in the reconstructed instruction queue. the raw signals required for reconstruction of the queue are addr, data, r/w , eclk, and status signals ipipe[1:0]. the instruction queue consists of two 16-bit queue stages and a holding latch on the input of the first stage. to advance the queue means to move the word in the first stage to the second stage and move the word from either the holding latch or the data bus input buffer into the first stage. to start even (or odd) instruction means to execute the opcode in the high-order (or low-order) byte of the second stage of the instruction queue. table 19-1i. pipe decoding data movement ? ipipe[1:0] captured at rising edge of e clock (1) 1. refers to data that was on the bus at the previous e falling edge. ipipe[1:0] mnemonic meaning 0:0 ? no movement 0:1 lat latch data from bus 1:0 ald advance queue and load from bus 1:1 all advance queue and load from latch execution start ? ipipe[1:0] captured at falling edge of e clock (2) 2. refers to bus cycle starting at this e falling edge. ipipe[1:0] mnemonic meaning 0:0 ? no start 0:1 int start interrupt sequence 1:0 sev start even instruction 1:1 sod start odd instruction
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 339 19.4 background debug mode background debug mode (bdm) is used for system development, in- circuit testing, field testing, and programming. bdm is implemented in on-chip hardware and provides a full set of debug options. because bdm control logic does not reside in the cpu, bdm hardware commands can be executed while the cpu is operating normally. the control logic generally uses free cpu cycles to execute these commands, but can steal cycles from the cpu when necessary. other bdm commands are firmware based, and require the cpu to be in active background mode for execution. while bdm is active, the cpu executes a firmware program located in a small on-chip rom that is available in the standard 64-kbyte memory map only while bdm is active. the bdm control logic communicates with an external host development system serially, via the bkgd pin. this single-wire approach minimizes the number of pins needed for development support. 19.4.1 enabling bdm firmware commands bdm is available in all operating modes, but must be made active before firmware commands can be executed. bdm is enabled by setting the enbdm bit in the bdm status register via the single wire interface (using a hardware command; write_bd_byte at $ff01). bdm must then be activated to map bdm registers and rom to addresses $ff00 to $ffff and to put the mcu in active background mode. after the firmware is enabled, bdm can be activated by the hardware background command, by the bdm tagging mechanism, or by the cpu bgnd instruction. an attempt to activate bdm before firmware has been enabled causes the mcu to resume normal instruction execution after a brief delay. bdm becomes active at the next instruction boundary following execution of the bdm background command, but tags activate bdm before a tagged instruction is executed.
development support advance information 68hc(9)12d60 ? rev 3.0 340 development support motorola in special single-chip mode, background operation is enabled and active immediately out of reset. this active case replaces the m68hc11 boot function, and allows programming a system with blank memory. while bdm is active, a set of bdm control registers are mapped to addresses $ff00 to $ff06. the bdm control logic uses these registers which can be read anytime by bdm logic, not user programs. refer to bdm registers for detailed descriptions. some on-chip peripherals have a bdm control bit which allows suspending the peripheral function during bdm. for example, if the timer control is enabled, the timer counter is stopped while in bdm. once normal program flow is continued, the timer counter is re-enabled to simulate real-time operations. 19.4.2 bdm serial interface the bdm serial interface requires the external controller to generate a falling edge on the bkgd pin to indicate the start of each bit time. the external controller provides this falling edge whether data is transmitted or received. bkgd is a pseudo-open-drain pin that can be driven either by an external controller or by the mcu. data is transferred msb first at 16 b- clock cycles per bit (nominal speed). the interface times out if 512 b- clock cycles occur between falling edges from the host. the hardware clears the command register when a time-out occurs. the bkgd pin can receive a high or low level or transmit a high or low level. the following diagrams show timing for each of these cases. interface timing is synchronous to mcu clocks but asynchronous to the external host. the internal clock signal is shown for reference in counting cycles. figure 19-1 shows an external host transmitting a logic one or zero to the bkgd pin of a target 68hc(9)12d60 mcu. the host is asynchronous to the target so there is a 0-to-1 cycle delay from the host-generated falling edge to where the target perceives the beginning of the bit time. ten target b cycles later, the target senses the bit level on the bkgd pin. typically the host actively drives the pseudo-open-drain bkgd pin
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 341 during host-to-target transmissions to speed up rising edges. since the target does not drive the bkgd pin during this period, there is no need to treat the line as an open-drain signal during host-to-target transmissions. figure 19-1. bdm host to target serial bit timing figure 19-2. bdm target to host serial bit timing (logic 1) 10 cycles b clock (target mcu) host transmit 1 target senses bit earliest start of next bit synchronization uncertainty perceived start of bit time host transmit 0 10 cycles b clock (target mcu) earliest start of next bit bkgd pin perceived start of bit time 10 cycles host samples bkgd pin host drive to bkgd pin target mcu speedup pulse r-c rise high-impedance high-impedance high-impedance
development support advance information 68hc(9)12d60 ? rev 3.0 342 development support motorola figure 19-2 shows the host receiving a logic one from the target 68hc(9)12d60 mcu. since the host is asynchronous to the target mcu, there is a 0-to-1 cycle delay from the host-generated falling edge on bkgd to the perceived start of the bit time in the target mcu. the host holds the bkgd pin low long enough for the target to recognize it (at least two target b cycles). the host must release the low drive before the target mcu drives a brief active-high speed-up pulse seven cycles after the perceived start of the bit time. the host should sample the bit level about ten cycles after it started the bit time. figure 19-3. bdm target to host serial bit timing (logic 0) figure 19-3 shows the host receiving a logic zero from the target 68hc(9)12d60 mcu. since the host is asynchronous to the target mcu, there is a 0-to-1 cycle delay from the host-generated falling edge on bkgd to the start of the bit time as perceived by the target mcu. the host initiates the bit time but the target 68hc(9)12d60 finishes it. since the target wants the host to receive a logic zero, it drives the bkgd pin low for 13 b-clock cycles, then briefly drives it high to speed up the rising edge. the host samples the bit level about ten cycles after starting the bit time. 10 cycles b clock (target mcu) earliest start of next bit bkgd pin perceived start of bit time 10 cycles host samples bkgd pin host drive to bkgd pin target mcu drive and speedup pulse high-impedance speedup pulse
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 343 19.4.3 bdm commands the bdm command set consists of two types: hardware and firmware. hardware commands allow target system memory to be read or written. target system memory includes all memory that is accessible by the cpu12 including eeprom, on-chip i/o and control registers, and external memory that is connected to the target hc12 mcu. hardware commands are implemented in hardware logic and do not require the hc12 mcu to be in bdm mode for execution. the control logic watches the cpu12 buses to find a free bus cycle to execute the command so the background access does not disturb the running application programs. if a free cycle is not found within 128 b-clock cycles, the cpu12 is momentarily frozen so the control logic can steal a cycle. commands implemented in bdm control logic are listed in table 19-2 .
development support advance information 68hc(9)12d60 ? rev 3.0 344 development support motorola the second type of bdm commands are firmware commands implemented in a small rom within the hc12 mcu. the cpu must be in background mode to execute firmware commands. the usual way to get to background mode is by the hardware command background. the bdm rom is located at $ff20 to $ffff while bdm is active. there are also seven bytes of bdm registers located at $ff00 to $ff06 when bdm is active. the cpu executes code in the bdm firmware to perform the requested operation. the bdm firmware watches for serial commands and executes them as they are received. the firmware commands are shown in table 19-3 . table 19-2. hardware commands (1) command opcode (hex) data description background 90 none enter background mode if firmware enabled. read_bd_byte (1) e4 16-bit address 16-bit data out read from memory with bdm in map (may steal cycles if external access) data for odd address on low byte, data for even address on high byte. read_bd_word (1) ec 16-bit address 16-bit data out read from memory with bdm in map (may steal cycles if external access). must be aligned access. read_byte e0 16-bit address 16-bit data out read from memory with bdm out of map (may steal cycles if external access) data for odd address on low byte, data for even address on high byte. read_word e8 16-bit address 16-bit data out read from memory with bdm out of map (may steal cycles if external access). must be aligned access. write_bd_byte (1) c4 16-bit address 16-bit data in write to memory with bdm in map (may steal cycles if external access) data for odd address on low byte, data for even address on high byte. write_bd_word (1) cc 16-bit address 16-bit data in write to memory with bdm in map (may steal cycles if external access). must be aligned access. write_byte c0 16-bit address 16-bit data in write to memory with bdm out of map (may steal cycles if external access) data for odd address on low byte, data for even address on high byte. write_word c8 16-bit address 16-bit data in write to memory with bdm out of map (may steal cycles if external access). must be aligned access. 1. use these commands only for reading/writing to bdm locations . the bdm firmware rom and bdm registers are not nor- mally in the hc12 mcu memory map . since these locations have the same addresses as some of the normal application memory map, there needs to be a way to decide which physical locations are being accessed by the hardware bdm commands . this gives rise to needing separate memory access commands for the bdm locations as opposed to the normal application locations . in logic, this is accomplished by momentarily enabling the bdm memory resources, just for the access cycles of the read_bd and write_bd commands . this logic allows the debugging system to unobtrusively access the bdm locations even if the application program is running out of the same memory area in the normal appli- cation memory map .
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 345 each of the hardware and firmware bdm commands start with an 8-bit command code (opcode). depending upon the commands, a 16-bit address and/or a 16-bit data word is required as indicated in the tables by the command. all the read commands output 16-bits of data despite the byte/word implication in the command name. the external host should wait 150 bclk cycles for a non-intrusive bdm command to execute before another command is sent. this delay includes 128 bclk cycles for the maximum delay for a free cycle. for data read commands, the host must insert this delay between sending the address and attempting to read the data. in the case of a write command, the host must delay after the data portion before sending a new command to be sure that the write has finished. the external host should delay about 32 target bclk cycles between a firmware read command and the data portion of these commands. this allows the bdm firmware to execute the instructions needed to get the requested data into the bdm shifter register. table 19-3. bdm firmware commands command opcode (hex) data description read_next 62 16-bit data out x = x + 2; read next word pointed to by x read_pc 63 16-bit data out read program counter read_d 64 16-bit data out read d accumulator read_x 65 16-bit data out read x index register read_y 66 16-bit data out read y index register read_sp 67 16-bit data out read stack pointer write_next 42 16-bit data in x = x + 2; write next word pointed to by x write_pc 43 16-bit data in write program counter write_d 44 16-bit data in write d accumulator write_x 45 16-bit data in write x index register write_y 46 16-bit data in write y index register write_sp 47 16-bit data in write stack pointer go 08 none go to user program trace1 10 none execute one user instruction then return to bdm taggo 18 none enable tagging and go to user program
development support advance information 68hc(9)12d60 ? rev 3.0 346 development support motorola the external host should delay about 32 target bclk cycles after the data portion of firmware write commands to allow bdm firmware to complete the requested write operation before a new serial command disturbs the bdm shifter register. the external host should delay about 64 target bclk cycles after a trace1 or go command before starting any new serial command. this delay is needed because the bdm shifter register is used as a temporary data holding register during the exit sequence to user code. bdm logic retains control of the internal buses until a read or write is completed. if an operation can be completed in a single cycle, it does not intrude on normal cpu12 operation. however, if an operation requires multiple cycles, cpu12 clocks are frozen until the operation is complete. 19.4.4 bdm lockout the access to the mcu resources by bdm may be prevented by enabling the bdm lockout feature. when enabled, the bdm lockout mechanism prevents the bdm from being active. in this case the bdm rom is disabled and does not appear in the mcu memory map. bdm lockout is enabled by clearing nobdml bit of eemcr register. the nobdml bit is loaded at reset from the shadow byte of eeprom module. modifying the state of the nobdml and corresponding eeprom shadow bit is only possible in special modes. please refer to eeprom memory for nobdml information. 19.4.5 enabling bdm lockout enabling the bdm lockout feature is only possible in special modes (smodn=0) and is accomplished by the following steps. 1. remove the shadow byte protection by clearing shprot bit in eeprot register. 2. clear noshb bit in eemcr register to make the shadow byte visible at $0fc0. 3. program bit 7 of the shadow byte like a regular eeprom
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 347 location at address $0fc0 (write $7f into address $0fc0). do not program other bits of the shadow byte (location $0fc0); otherwise some regular eeprom array locations will not be visible. at the next reset, the shadow byte is loaded into the eemcr register. nobdml bit in eemcr will be cleared and bdm will not be operational. 4. protect the shadow byte by setting shprot bit in eeprot register. 19.4.6 disabling bdm lockout disabling the bdm lockout is only possible in special modes (smodn=0) except in special single chip mode. follow the same steps as for enabling the bdm lockout, but erase the shadow byte. at the next reset, the shadow byte is loaded into the eemcr register. nobdml bit in eemcr will be set and bdm becomes operational. note: when the bdm lockout is enabled it is not possible to run code from the reset vector in special single chip mode. 19.4.7 bdm registers seven bdm registers are mapped into the standard 64-kbyte address space when bdm is active. mapping is shown in table 19-4 .  the instruction register content is determined by the type of background command being executed.  the status register indicates bdm operating conditions. table 19-4. bdm registers address register $ff00 bdm instruction register $ff01 bdm status register $ff02 - $ff03 bdm shift register $ff04 - $ff05 bdm address register $ff06 bdm ccr holding register
development support advance information 68hc(9)12d60 ? rev 3.0 348 development support motorola  the shift register contains data being received or transmitted via the serial interface.  the address register is temporary storage for bdm commands.  the ccrsav register preserves the content of the cpu12 ccr while bdm is active. the only registers of interest to users are the status register and the ccrsav register. the other bdm registers are only used by the bdm firmware to execute commands. the registers are accessed by means of the hardware read_bd and write_bd commands, but should not be written during bdm operation (except the ccrsav register which could be written to modify the ccr value). 19.4.8 status the status register is read and written by the bdm hardware as a result of serial data shifted in on the bkgd pin. read: all modes. write: bits 3 through 5, and bit 7 are writable in all modes. bit 6, bdmact, can only be written if bit 7 h/f in the instruction register is a zero. bit 2, clksw, can only be written if bit 7 h/f in the instruction register is a one. a user would never write ones to bits 3 through 5 because these bits are only used by bdm firmware. bit 7654321bit 0 enbdm bdmact entag sdv trace clksw - - reset: 0 (note 1) 1000000 special sin- gle chip & periph reset: 00000000 all other modes status ? bdm status register (1) $ff01 1. enbdm is set to 1 by the firmware in special single chip mode.
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 349 enbdm ? enable bdm (permit active background debug mode) 0 = bdm cannot be made active (hardware commands still allowed). 1 = bdm can be made active to allow firmware commands. bdmact ? background mode active status bdmact becomes set as active bdm mode is entered so that the bdm firmware rom is enabled and put into the map. bdmact is cleared by a carefully timed store instruction in the bdm firmware as part of the exit sequence to return to user code and remove the bdm memory from the map. this bit has 4 clock cycles write delay. 0 = bdm is not active. bdm rom and registers are not in map. 1 = bdm is active and waiting for serial commands. bdm rom and registers are in map the user should be careful that the state of the bdmact bit is not unintentionally changed with the write_next firmware command. if it is unintentionally changed from 1 to 0, it will cause a system runaway because it would disable the bdm firmware rom while the cpu12 was executing bdm firmware. the following two commands show how bdmact may unintentionally get changed from 1 to 0. write_x with data $fefe write_next with data $c400 the first command writes the data $fefe to the x index register. the second command writes the data $c4 to the $ff00 instruction register and also writes the data $00 to the $ff01 status register. entag ? tagging enable set by the taggo command and cleared when bdm mode is entered. the serial system is disabled and the tag function enabled 16 cycles after this bit is written. 0 = tagging not enabled, or bdm active. 1 = tagging active. bdm cannot process serial commands while tagging is active.
development support advance information 68hc(9)12d60 ? rev 3.0 350 development support motorola sdv ? shifter data valid shows that valid data is in the serial interface shift register. used by the bdm firmware. 0 = no valid data. shift operation is not complete. 1 = valid data. shift operation is complete. trace ? asserted by the trace1 command clksw ? clock switch 0 = bdm system operates with bclk. 1 = bdm system operates with eclk. the write_bd_byte@ff01 command that changes clksw including 150 cycles after the data portion of the command should be timed at the old speed. beginning with the start of the next bdm command, the new clock can be used for timing bdm communications. if eclk rate is slower than bclk rate, clksw is ignored and bdm system is forced to operate with eclk. 19.4.9 instruction - hardware instruction decode the instruction register is written by the bdm hardware as a result of serial data shifted in on the bkgd pin. it is readable and writable in special peripheral mode on the parallel bus. it is discussed here for two conditions: when a hardware command is executed and when a firmware command is executed. read and write: all modes the hardware clears the instruction register if 512 bclk cycles occur between falling edges from the host. bit 7654321bit 0 h/f data r/w bkgnd w/b bd/u 0 0 reset: 0 0 0 0 0 0 0 0 instruction ? bdm instruction register (hardware command explanation) $ff00
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 351 the bits in the bdm instruction register have the following meanings when a hardware command is executed. h/f ? hardware/firmware flag 0 = firmware command 1 = hardware command data ? data flag - shows that data accompanies the command. 0 = no data 1 = data follows the command r/w ? read/write flag 0 = write 1 = read bkgnd ? hardware request to enter active background mode 0 = not a hardware background command 1 = hardware background command (instruction = $90) w/b ? word/byte transfer flag 0 = byte transfer 1 = word transfer bd/u ? bdm map/user map flag indicates whether bdm registers and rom are mapped to addresses $ff00 to $ffff in the standard 64-kbyte address space. used only by hardware read/write commands. 0 = bdm resources not in map 1 = bdm rom and registers in map the bits in the bdm instruction register have the following meanings when a firmware command is executed. bit 7654321bit 0 h/f data r/w ttago regn instruction ? bdm instruction register (firmware command bit explanation) $ff00
development support advance information 68hc(9)12d60 ? rev 3.0 352 development support motorola h/f ? hardware/firmware flag 0 = firmware command 1 = hardware command data ? data flag - shows that data accompanies the command. 0 = no data 1 = data follows the command r/w ? read/write flag 0 = write 1 = read ttago ? trace, tag, go field regn ? register/next field indicates which register is being affected by a command. in the case of a read_next or write_next command, index register x is pre-incriminated by 2 and the word pointed to by x is then read or written. table 19-5. ttago decoding table 19-6ttago value table 19-7instruction 00 ? 01 go 10 trace1 11 taggo table 19-8. regn decoding regn value instruction 000 ? 001 ? 010 read/write next 011 pc 100 d 101 x 110 y 111 sp
development support background debug mode 68hc(9)12d60 ? rev 3.0 advance information motorola development support 353 19.4.10 shifter this 16-bit shift register contains data being received or transmitted via the serial interface. it is also used by the bdm firmware for temporary storage. read: all modes (but not normally accessed by users) write: all modes (but not normally accessed by users) bit 15 14 13 12 11 10 9 bit 8 s15 s14 s13 s12 s11 s10 s9 s8 reset: xxxxxxxx shifter ? bdm shift register - high byte $ff02 bit 7654321bit 0 s7 s6 s5 s4 s3 s2 s1 s0 reset: xxxxxxxx shifter ? bdm shift register - low byte $ff03
development support advance information 68hc(9)12d60 ? rev 3.0 354 development support motorola 19.4.11 address this 16-bit address register is temporary storage for bdm hardware and firmware commands. read: all modes (but not normally accessed by users) write: only by bdm hardware (state machine) bit 15 14 13 12 11 10 9 bit 8 a15 a14 a13 a12 a11 a10 a9 a8 reset: xxxxxxxx address ? bdm address register - high byte $ff04 bit 7654321bit 0 a7 a6 a5 a4 a3 a2 a1 a0 reset: xxxxxxxx address ? bdm address register - low byte $ff05
development support breakpoints 68hc(9)12d60 ? rev 3.0 advance information motorola development support 355 19.4.12 ccrsav the ccrsav register is used to save the ccr of the users program when entering bdm. it is also used for temporary storage in the bdm firmware. read and write: all modes 19.5 breakpoints hardware breakpoints are used to debug software on the 68hc(9)12d60 by comparing actual address and data values to predetermined data in setup registers. a successful comparison will place the cpu in background debug mode (bdm) or initiate a software interrupt (swi). breakpoint features designed into the 68hc(9)12d60 include:  mode selection for bdm or swi generation  program fetch tagging for cycle of execution breakpoint  second address compare in dual address modes  range compare by disable of low byte address  data compare in full feature mode for non-tagged breakpoint  byte masking for high/low byte data compares  r/w compare for non-tagged compares  tag inhibit on bdm trace bit 7654321bit 0 ccr7 ccr6 ccr5 ccr4 ccr3 ccr2 ccr1 ccr0 reset: note 1 (1) xxxxxxxx ccrsav ? bdm ccr holding register $ff06 1. initialized to equal the cpu12 ccr register by the firmware.
development support advance information 68hc(9)12d60 ? rev 3.0 356 development support motorola 19.5.1 breakpoint modes three modes of operation determine the type of breakpoint in effect.  dual address-only breakpoints, each of which will cause a software interrupt (swi)  single full-feature breakpoint which will cause the part to enter background debug mode (bdm)  dual address-only breakpoints, each of which will cause the part to enter bdm breakpoints will not occur when bdm is active. 19.5.2 swi dual address mode in this mode, dual address-only breakpoints can be set, each of which cause a software interrupt. this is the only breakpoint mode which can force the cpu to execute a swi. program fetch tagging is the default in this mode; data breakpoints are not possible. in the dual mode each address breakpoint is affected by the bkpm bit and the bkale bit. the bkxrw and bkxrwe bits are ignored. in dual address mode the bkdbe becomes an enable for the second address breakpoint. the bksz8 bit will have no effect when in a dual address mode. 19.5.3 bdm full breakpoint mode a single full feature breakpoint which causes the part to enter background debug mode. bdm mode may be entered by a breakpoint only if an internal signal from the bdm indicates background debug mode is enabled.  breakpoints are not allowed if the bdm mode is already active. active mode means the cpu is executing out of the bdm rom.  bdm should not be entered from a breakpoint unless the enable bit is set in the bdm. this is important because even if the enable bit in the bdm is negated the cpu actually does execute
development support breakpoints 68hc(9)12d60 ? rev 3.0 advance information motorola development support 357 the bdm rom code. it checks the enable and returns if not set. if the bdm is not serviced by the monitor then the breakpoint would be re-asserted when the bdm returns to normal cpu flow.  there is no hardware to enforce restriction of breakpoint operation if the bdm is not enabled. 19.5.4 bdm dual address mode dual address-only breakpoints, each of which cause the part to enter background debug mode. in the dual mode each address breakpoint is affected, consistent across modes, by the bkpm bit, the bkale bit, and the bkxrw and bkxrwe bits. in dual address mode the bkdbe becomes an enable for the second address breakpoint. the bksz8 bit will have no effect when in a dual address mode. bdm mode may be entered by a breakpoint only if an internal signal from the bdm indicates background debug mode is enabled.  bkdbe will be used as an enable for the second address only breakpoint.  breakpoints are not allowed if the bdm mode is already active. active mode means the cpu is executing out of the bdm rom.  bdm should not be entered from a breakpoint unless the enable bit is set in the bdm. this is important because even if the enable bit in the bdm is negated the cpu actually does execute the bdm rom code. it checks the enable and returns if not set. if the bdm is not serviced by the monitor then the breakpoint would be re-asserted when the bdm returns to normal cpu flow. there is no hardware to enforce restriction of breakpoint operation if the bdm is not enabled. 19.5.5 breakpoint registers breakpoint operation consists of comparing data in the breakpoint address registers (brkah/brkal) to the address bus and comparing data in the breakpoint data registers (brkdh/brkdl) to the data bus. the breakpoint data registers can also be compared to the address bus.
development support advance information 68hc(9)12d60 ? rev 3.0 358 development support motorola the scope of comparison can be expanded by ignoring the least significant byte of address or data matches. the scope of comparison can be limited to program data only by setting the bkpm bit in breakpoint control register 0. to trace program flow, setting the bkpm bit causes address comparison of program data only. control bits are also available that allow checking read/write matches. read and write anytime. this register is used to control the breakpoint logic. bken1, bken0 ? breakpoint mode enable bkpm ? break on program addresses this bit controls whether the breakpoint will cause a break on a match (next instruction boundary) or on a match that will be an executable opcode. data and non-executed opcodes cannot cause a break if this bit is set. this bit has no meaning in swi dual address mode. the swi mode only performs program breakpoints. 0 = on match, break at the next instruction boundary 1 = on match, break if the match is an instruction that will be executed. this uses tagging as its breakpoint mechanism. bit 7654321bit 0 bken1 bken0 bkpm 0 bk1ale bk0ale 0 0 reset:00000000 brkct0 ? breakpoint control register 0 $0020 table 19-9. breakpoint mode control bken1 bken0 mode selected brkah/l usage brkdh/l usage r/w range 0 0 breakpoints off ???? 01swi ? dual address mode address match address match no yes 10bdm ? full breakpoint mode address match data match yes yes 11bdm ? dual address mode address match address match yes yes
development support breakpoints 68hc(9)12d60 ? rev 3.0 advance information motorola development support 359 bk1ale ? breakpoint 1 range control only valid in dual address mode. 0 = brkdl will not be used to compare to the address bus. 1 = brkdl will be used to compare to the address bus. bk0ale ? breakpoint 0 range control valid in all modes. 0 = brkal will not be used to compare to the address bus. 1 = brkal will be used to compare to the address bus. this register is read/write in all modes. bkdbe ? enable data bus enables comparing of address or data bus values using the brkdh/l registers. 0 = the brkdh/l registers are not used in any comparison 1 = the brkdh/l registers are used to compare address or data (depending upon the mode selections bken1,0) table 19-10. breakpoint address range control bk1ale bk0ale address range selected ? 0 upper 8-bit address only for full mode or dual mode bkp0 ? 1 full 16-bit address for full mode or dual mode bkp0 0 ? upper 8-bit address only for dual mode bkp1 1 ? full 16-bit address for dual mode bkp1 bit 7654321bit 0 0 bkdbe bkmbh bkmbl bk1rwe bk1rw bk0rwe bk0rw reset: 0 0 0 0 0 0 0 0 brkct1 ? breakpoint control register 1 $0021
development support advance information 68hc(9)12d60 ? rev 3.0 360 development support motorola bkmbh ? breakpoint mask high disables the comparing of the high byte of data when in full breakpoint mode. used in conjunction with the bkdbe bit (which should be set) 0 = high byte of data bus (bits 15:8) are compared to brkdh 1 = high byte is not used in comparisons bkmbl ? breakpoint mask low disables the matching of the low byte of data when in full breakpoint mode. used in conjunction with the bkdbe bit (which should be set) 0 = low byte of data bus (bits 7:0) are compared to brkdl 1 = low byte is not used in comparisons. bk1rwe ? r/w compare enable enables the comparison of the r/w signal to further specify what causes a match. this bit is not useful in program breakpoints or in full breakpoint mode. this bit is used in conjunction with a second address in dual address mode when bkdbe=1. 0 = r/w is not used in comparisons 1 = r/w is used in comparisons bk1rw ? r/w compare value when bk1rwe = 1, this bit determines the type of bus cycle to match. 0 = a write cycle will be matched 1 = a read cycle will be matched bk0rwe ? r/w compare enable enables the comparison of the r/w signal to further specify what causes a match. this bit is not useful in program breakpoints. 0 = r/w is not used in the comparisons 1 = r/w is used in comparisons bk0rw ? r/w compare value when bk0rwe = 1, this bit determines the type of bus cycle to match on. 0 = write cycle will be matched 1 = read cycle will be matched
development support breakpoints 68hc(9)12d60 ? rev 3.0 advance information motorola development support 361 these bits are used to compare against the most significant byte of the address bus. these bits are used to compare against the least significant byte of the address bus. these bits may be excluded from being used in the match if bk0ale = 0. table 19-11. breakpoint read/write control bk1rwe bk1rw bk0rwe bk0rw read/write selected ?? 0xr/w is don ? t care for full mode or dual mode bkp0 ?? 10r/w is write for full mode or dual mode bkp0 ?? 11r/w is read for full mode or dual mode bkp0 0x ?? r/w is don ? t care for dual mode bkp1 10 ?? r/w is write for dual mode bkp1 11 ?? r/w is read for dual mode bkp1 bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 reset: 0 0 000000 brkah ? breakpoint address register, high byte $0022 bit 7654321bit 0 bit 7654321bit 0 reset: 0 0 000000 brkal ? breakpoint address register, low byte $0023
development support advance information 68hc(9)12d60 ? rev 3.0 362 development support motorola these bits are compared to the most significant byte of the data bus or the most significant byte of the address bus in dual address modes. bken[1:0], bkdbe, and bkmbh control how this byte will be used in the breakpoint comparison. these bits are compared to the least significant byte of the data bus or the least significant byte of the address bus in dual address modes. bken[1:0], bkdbe, bk1ale, and bkmbl control how this byte will be used in the breakpoint comparison. 19.6 instruction tagging the instruction queue and cycle-by-cycle cpu activity can be reconstructed in real time or from trace history that was captured by a logic analyzer. however, the reconstructed queue cannot be used to stop the cpu at a specific instruction, because execution has already begun by the time an operation is visible outside the mcu. a separate instruction tagging mechanism is provided for this purpose. executing the bdm taggo command configures two mcu pins for tagging. the taglo signal shares a pin with the lstrb signal, and the bit 7654321bit 0 bit 15 14 13 12 11 10 9 bit 8 reset: 0 0 000000 brkdh ? breakpoint data register, high byte $0024 bit 7654321bit 0 bit 7654321bit 0 reset: 0 0 000000 brkdl ? breakpoint data register, low byte $0025
development support advance information 68hc(9)12d60 ? rev 3.0 363 development support motorola taghi signal shares a pin with the bkgd signal. tagging information is latched on the falling edge of eclk. table 19-12 shows the functions of the two tagging pins. the pins operate independently - the state of one pin does not affect the function of the other. the presence of logic level zero on either pin at the fall of eclk performs the indicated function. tagging is allowed in all modes. tagging is disabled when bdm becomes active and bdm serial commands are not processed while tagging is active. the tag follows program information as it advances through the queue. when a tagged instruction reaches the head of the queue, the cpu enters active background debugging mode rather than execute the instruction. table 19-12. tag pin function taghi taglo tag 1 1 no tag 10 low byte 0 1 high byte 0 0 both bytes
development support advance information 68hc(9)12d60 ? rev 3.0 364 development support motorola
68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 365 advance information ? 68hc(9)12d60 section 20. electrical specifications 20.1 contents 20.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 20.3 tables of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 20.2 introduction this section contains the most accurate electrical information for the 68hc(9)12d60 microcontroller available at the time of publication.
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 366 electrical specifications motorola 20.3 tables of data table 20-1. maximum ratings (1) 1. permanent damage can occur if maximum ratings are exceeded. exposures to voltages or currents in excess of recom- mended values affects device reliability. device modules may not operate normally while being exposed to electrical ex- tremes. rating symbol value unit supply voltage v dd , v dda , v ddx, v ddpll ? 0.3 to + 6.5 v input voltage v in ? 0.3 to + 6.5 v operating temperature range 68hc(9)12d60pv8 68hc(9)12d60cpv8 68hc(9)12d60vpv8 68hc(9)12d60mpv8 (single chip mode only) t a t l to t h 0 to + 70 ? 40 to + 85 ? 40 to +105 ? 40 to +125 c operating temperature range 68hc(9)12d60fu8 68hc(9)12d60cfu8 68hc(9)12d60vfu8 68hc(9)12d60mfu8 (single chip mode only) t a t l to t h 0 to + 70 ? 40 to + 85 ? 40 to +105 ? 40 to +125 c storage temperature range t stg ? 55 to + 150 c current drain per pin (2) excluding v dd and v ss 2. one pin at a time, observing maximum power dissipation limits. internal circuitry protects the inputs against damage caused by high static voltages or electric fields; however, normal precautions are necessary to avoid application of any voltage higher than maximum-rated voltages to this high-impedance circuit. extended operation at the maximum ratings can ad- versely affect device reliability. tying unused inputs to an appropriate logic voltage level (either gnd or v dd ) enhances reliability of operation. i in 25 ma v dd differential voltage v dd ? v ddx 6.5 v
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 367 table 20-2. thermal characteristics characteristic symbol value unit average junction temperature t j t a + (p d ja ) c ambient temperature t a user-determined c package thermal resistance (junction-to-ambient) 68hc912d60 80-pin quad flat pack (qfp) 112-pin thin quad flat pack (tqfp) ja 65 46 c/w package thermal resistance (junction-to-ambient) 68hc12d60 80-pin quad flat pack (qfp) 112-pin thin quad flat pack (tqfp) ja 70 48 c/w total power dissipation (1) p d p int + p i/o or w device internal power dissipation p int i dd v dd w i/o pin power dissipation (2) p i/o user-determined w a constant (3) k p d (t a + 273 c) + ja p d 2 w c 1. this is an approximate value, neglecting p i/o . 2. for most applications p i/o ? p int and can be neglected. 3. k is a constant pertaining to the device. solve for k with a known t a and a measured p d (at equilibrium). use this value of k to solve for p d and t j iteratively for any value of t a . k t j 273 c +
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 368 electrical specifications motorola table 20-3. dc electrical characteristics v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted characteristic symbol min max unit input high voltage, all inputs v ih 0.7 v dd v dd + 0.3 v input low voltage, all inputs v il v ss ? 0.3 0.2 v dd v output high voltage, all i/o and output pins except xtal normal drive strength i oh = ? 10.0 a i oh = ? 0.8 ma reduced drive strength i oh = ? 4.0 a i oh = ? 0.3 ma v oh v dd ? 0.2 v dd ? 0.8 v dd ? 0.2 v dd ? 0.8 ? ? ? ? v v v v output low voltage, all i/o and output pins except xtal normal drive strength i ol = 10.0 a i ol = 1.6 ma reduced drive strength i ol = 3.6 a i ol = 0.6 ma v ol ? ? ? ? v ss + 0.2 v ss + 0.4 v ss + 0.2 v ss + 0.4 v v v v input leakage current (1) v in = v dd or v ss all input only pins except atd (2) and v fp v in = v dd or v ss i in ? ? 2.5 10 a a three-state leakage, i/o ports, bkgd, and reset i oz ? 2.5 a input capacitance all input pins and atd pins (non-sampling) atd pins (sampling) all i/o pins c in ? ? ? 10 15 20 pf pf pf output load capacitance all outputs except ps[7:4] ps[7:4] when configured as spi c l ? ? 90 200 pf pf programmable active pull-up current xirq , irq , dbe , lstrb , r/w , ports a, b, can, p,s, t moda, modb active pull down during reset bkgd passive pull up i apu 50 50 50 500 500 500 a a a 1. specification is for parts in the -40 to +85 c range. higher temperature ranges will result in increased current leakage. 2. see table 20-5 .
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 369 table 20-4. supply current v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted characteristic symbol 2 mhz (1) 4 mhz (1) 8 mhz unit maximum total supply current run: single-chip mode expanded mode i dd 18 30 30 50 50 85 ma ma wait: (all peripheral functions shut down) single-chip mode expanded mode w idd 4 5 6 9 8 12 ma ma stop: single-chip mode, no clocks ? 40 to + 85 + 85 to + 105 + 105 to + 125 s idd 10 50 50 10 50 50 10 50 50 a a a maximum power dissipation (2) single-chip mode expanded mode p d 100 165 165 275 275 467 mw mw 1. these are typical values only and are not tested. 2. includes i dd and i dda . table 20-5. atd dc electrical characteristics v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , atd clock = 2 mhz, unless otherwise noted characteristic symbol min max unit analog supply voltage v dda 4.5 5.5 v analog supply current, normal operation (1) i dda 1.0 ma reference voltage, low v rl v ssa v dda / 2 v reference voltage, high v rh v dda / 2v dda v v ref differential reference voltage (2) v rh ? v rl 4.5 5.5 v input voltage (3) v indc v ssa v dda v input current, off channel (4) i off 100 na reference supply current i ref 250 a input capacitance not sampling sampling c inn c ins 10 15 pf pf 1. for each atd module 2. accuracy is guaranteed at v rh ? v rl = 5.0v 10%. 3. to obtain full-scale, full-range results, v ssa v rl v indc v rh v dda . 4. maximum leakage occurs at maximum operating temperature. current decreases by approximately one-half for each 10 c decrease from maximum temperature.
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 370 electrical specifications motorola table 20-6. analog converter characteristics (operating) v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , atd clock = 2 mhz, unless otherwise noted characteristic symbol min typical max unit 8-bit resolution (1) 1 count 20 mv 8-bit differential non-linearity (2) dnl ? 0.5 + 0.5 count 8-bit integral non-linearity (2) inl ? 1 + 1count 8-bit absolute error ,(3) 2, 4, 8, and 16 atd sample clocks ae ? 1 + 1count 10-bit resolution (1) 1 count 5 mv 10-bit differential non-linearity (2) dnl ? 22count 10-bit integral non-linearity (2) inl ? 22count 10-bit absolute error (3) 2, 4, 8, and 16 atd sample clocks ae ? 2.5 2.5 count maximum source impedance r s 20 see note (4) k ? 1. v rh ? v rl 5.12v; v dda ? v ssa = 5.12v 2. at v ref = 5.12v, one 8-bit count = 20 mv, and one 10-bit count = 5mv. inl and dnl are characterized using the process window parameters affecting the atd accuracy, but they are not tested. 3. these values include quantization error which is inherently 1/2 count for any a/d converter. accuracy tested when when v rl =v ss , v rh =v dd and external source impedence is close to zero. 4. maximum source impedance is application-dependent. error resulting from pin leakage depends on junction leakage into the pin and on leakage due to charge-sharing with internal capacitance. error from junction leakage is a function of external source impedance and input leakage current. expected error in result value due to junction leakage is expressed in voltage (v errj ): v errj = r s i off where i off is a function of operating temperature. charge-sharing effects with internal capacitors are a function of atd clock speed, the number of channels being scanned, and source impedance. for 8-bit conversions, charge pump leakage is computed as follows: v errj = .25pf v dda r s atdclk/(8 number of channels)
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 371 table 20-7. atd ac characteristics (operating) v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , atd clock = 2 mhz, unless otherwise noted characteristic symbol min max unit mcu clock frequency (p-clock) f pclk 2.0 8.0 mhz atd operating clock frequency f atdclk 0.5 2.0 mhz atd 8-bit conversion period clock cycles (1) conversion time (2) n conv8 t conv8 18 9 32 16 cycles s atd 10-bit conversion period clock cycles (1) conversion time (2) n conv10 t conv10 20 10 34 17 cycles s stop and atd power up recovery time (3) vdda = 5.0v t sr 10 s 1. the minimum time assumes a final sample period of 2 atd clock cycles while the maximum time assumes a final sample period of 16atd clocks. 2. this assumes an atd clock frequency of 2.0mhz. 3. from the time adpu is asserted until the time an atd conversion can begin. table 20-8. atd maximum ratings characteristic symbol value units atd reference voltage v rh v dda v rl v ssa v rh v rl ? 0.3 to + 6.5 ? 0.3 to + 6.5 v v v ss differential voltage | v ss ? v ssa | 0.1 v v dd differential voltage v dd ? v dda v dda ? v dd 6.5 0.3 v v v ref differential voltage | v rh ? v rl | 6.5 v reference to supply differential voltage | v rh ? v dda | 6.5 v
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 372 electrical specifications motorola use of an external circuit to condition v fp is recommended. figure 20-1 shows a simple circuit that maintains required voltages and filters transients. v fp is pulled to v dd via schottky diode d2. application of table 20-9. eeprom characteristics v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted characteristic symbol min typical max unit minimum programming clock frequency (1) f prog 1.0 mhz programming time t prog 10 10.5 ms clock recovery time, following stop, to continue programming t crstop t prog + 1 ms erase time t erase 10 10.5 ms write/erase endurance 10,000 30,000 (2) cycles data retention 10 years 1. rc oscillator must be enabled if programming is desired and f sys < f prog . 2. if average t h is below 85 c. table 20-10. flash eeprom characteristics (68hc912d60 only) v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted characteristic symbol min typical max units program/erase supply voltage: read only program / erase / verify v fp v dd ? 0.35 11.4 v dd 12 v dd + 0.5 12.6 v v program/erase supply current word program(v fp = 12v) erase(v fp = 12v) i fp 30 4 ma ma number of programming pulses n pp 50 pulses programming pulse t ppulse 20 25 s program to verify time t vprog 10 s program margin p m 100 (1) % number of erase pulses n ep 5pulses erase pulse t epulse 510ms erase to verify time t verase 1ms erase margin e m 100 (1) % program/erase endurance 100 cycles data retention 10 years 1. the number of margin pulses required is the same as the number of pulses used to program or erase.
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 373 programming voltage via diode reverse-biases d2, protecting v dd from excessive reverse current. d2 also protects the flash from damage should programming voltage go to 0. programming power supply voltage must be adjusted to compensate for the forward-bias drop across d1. the charge time constant of r1 and c1 filters transients, while r2 provides a discharge bleed path to c1. allow for rc charge and discharge time constants when applying and removing power. when using this circuit, keep leakage from external devices connected to the v fp pin low, to minimize diode voltage drop. figure 20-1v fp conditioning circuit figure 20-2v fp operating range d1 r1 22k ? 10 ? r2 d2 4.5v c1 0.1 f v dd v fp pin programming voltage power supply 13.5v 12.8v 11.4v 6.5v 4.5v 4.15v 0v ? 0.30v power on normal read power down program erase verify t er 30ns maximum v fp envelope v dd envelope combined v dd and v fp
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 374 electrical specifications motorola table 20-11. pulse width modulator characteristics v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted characteristic symbol min max unit e-clock frequency f eclk 0.004 8.0 mhz a-clock frequency selectable f aclk f eclk /128 f eclk hz b-clock frequency selectable f bclk f eclk /128 f eclk hz left-aligned pwm frequency 8-bit 16-bit f lpwm f eclk /1m f eclk /256m f eclk /2 f eclk /2 hz hz left-aligned pwm resolution r lpwm f eclk /4k f eclk hz center-aligned pwm frequency 8-bit 16-bit f cpwm f eclk /2m f eclk /512m f eclk f eclk hz hz center-aligned pwm resolution r cpwm f eclk /4k f eclk hz table 20-12. control timing characteristic symbol 8.0 mhz unit min max frequency of operation f o 0.004 8.0 mhz e-clock period t cyc 0.125 250 s external oscillator frequency f eo 0.5 16.0 (1) mhz processor control setup time t pcsu = t cyc / 2 + 20 t pcsu 82 ? ns reset input pulse width to guarantee external reset vector minimum input time (can be preempted by internal reset) pw rstl 32 2 ? ? t cyc t cyc mode programming setup time t mps 4 ? t cyc mode programming hold time t mph 10 ? ns interrupt pulse width, irq edge-sensitive mode pw irq = 2t cyc + 20 pw irq 270 ? ns wait recovery startup time t wrs ? 4 t cyc timer input capture pulse width pw tim = 2t cyc + 20 pw tim 270 ? ns 1. when using a quartz crystal, operation should be restricted to 8mhz.
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 375 note: reset is recognized during the first clock cycle it is held low. internal circuitry then drives the pin low for 16 clock cycles, releases the pin, and samples the pin level 8 cycles later to determine the source of the interrupt. figure 20-3. timer inputs pt7 2 pt7 1 pt[7:0] 2 pt[7:0] 1 notes : 1. rising edge sensitive input 2. falling edge sensitive input pw tim pw pa
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 376 electrical specifications motorola figure 20-4. por and external reset timing diagram t pcsu internal moda, modb eclk extal v dd reset 4098 t cyc free fffe fffe 3rd 1st 2nd free fffe fffe fffe t mph pw rstl t mps address pipe pipe pipe 1st exec 3rd pipe 2nd pipe 1st pipe 1st exec note: reset timing is subject to change.
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 377 figure 20-5. stop recovery timing diagram pw irq t stopdelay 3 irq 1 irq or xirq eclk 1st address 4 sp-9 free free vector free free resume program with instruction which follows the stop instruction. internal address 5 clocks notes: 1. edge sensitive irq pin (irqe bit = 1) 2. level sensitive irq pin (irqe bit = 0) 3. t stopdelay = 4098 t cyc if dly bit = 1 or 2 t cyc if dly = 0. 4. xirq with x bit in ccr = 1. 5. irq or (xirq with x bit in ccr = 0). opt 1st 2nd 3rd 1st exec pipe pipe exec sp-8 sp-6 fetch pipe sp-6 sp-8 sp-9
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 378 electrical specifications motorola figure 20-6. wait recovery timing diagram t pcsu pc, iy, ix, b:a, , ccr stack registers eclk r/w address irq , xirq , or internal interrupts sp ? 2sp ? 4 sp ? 6 . . . sp ? 9 sp ? 9 sp ? 9 . . . sp ? 9 sp ? 9 vector free 1st 2nd 3rd pipe t wrs note: reset also causes recovery from wait. address pipe pipe 1st exec
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 379 figure 20-7. interrupt timing diagram eclk pw irq 1st 3rd address irq 1 sp ? 9 t pcsu irq 2 , xirq , or internal interrupt vector sp ? 2 1st sp ? 4sp ? 6 2nd sp ? 8 data vect pc iy ix b:a ccr prog r/w notes: 1. edge sensitive irq pin (irqe bit = 1) 2. level sensitive irq pin (irqe bit = 0) fetch addr exec pipe pipe pipe prog fetch prog fetch
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 380 electrical specifications motorola figure 20-8. port read timing diagram figure 20-9. port write timing diagram table 20-13. peripheral port timing characteristic symbol 8.0 mhz unit min max frequency of operation (e-clock frequency) f o 0.004 8.0 mhz e-clock period t cyc 0.125 250 s peripheral data setup time mcu read of portst pdsu = t cyc / 2 + 40 t pdsu 102 ? ns peripheral data hold time mcu read of ports t pdh 0 ? ns delay time, peripheral data write mcu write to ports except port can t pwd ? 40 ns delay time, peripheral data write mcu write to port can t pwd ? 71 ns eclk mcu read of port ports t pdsu t pdh eclk mcu write to port previous port data new data valid port a t pwd
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 381 table 20-14. multiplexed expansion bus timing v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted num characteristic (1), (2), (3), (4) delay symbol 8 mhz 2mhz unit min max min max frequency of operation (e-clock frequency) f o 0.004 8.0 0.004 2.0 mhz 1 cycle timet cyc = 1 / f o ? t cyc 0.125 250 0.5 250 s 2 pulse width, e lowpw el = t cyc / 2 + delay ? 4 pw el 58 246 ns 3 pulse width, e high (5) pw eh = t cyc / 2 + delay ? 2 pw eh 60 248 ns 5 address delay timet ad = t cyc / 4 + delay 27 t ad 58 152 ns 7 address valid time to eclk riset av = pw el ? t ad ? t av 094ns 8 multiplexed address hold timet mah = t cyc / 4 + delay ? 18 t mah 13 107 ns 9 address hold to data valid ? t ahds 20 20 ns 10 data hold to high zt dhz = t ad ? 20 ? t dhz 38 132 ns 11 read data setup time ? t dsr 25 25 ns 12 read data hold time ? t dhr 00ns 13 write data delay time ? t ddw 47 165 ns 14 write data hold time ? t dhw 20 20 ns 15 write data setup time (5) t dsw = pw eh ? t ddw ? t dsw 13 83 ns 16 read/write delay timet rwd = t cyc / 4 + delay 18 t rwd 49 143 ns 17 read/write valid time to e riset rwv = pw el ? t rwd ? t rwv 9 103 ns 18 read/write hold time ? t rwh 20 20 ns 19 low strobe (6) delay timet lsd = t cyc / 4 + delay 18 t lsd 49 143 ns 20 low strobe (6) valid time to e riset lsv = pw el ? t lsd ? t lsv 9 103 ns 21 low strobe (6) hold time ? t lsh 20 20 ns 22 address access time (5) t acca = t cyc ? t ad ? t dsr ? t acca 42 323 ns 23 access time from e rise (5) t acce = pw eh ? t dsr ? t acce 35 223 ns 24 dbe delay from eclk rise (5) t dbed = t cyc / 4 + delay 8 t dbed 39 133 ns 25 dbe valid timet dbe = pw eh ? t dbed ? t dbe 21 115 ns 26 dbe hold time from eclk fall t dbeh ? 310 ? 310ns 1. all timings are calculated for normal port drives. 2. crystal input is required to be within 45% to 55% duty. 3. reduced drive must be off to meet these timings. 4. unequalled loading of pins will affect relative timing numbers.
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 382 electrical specifications motorola figure 20-10. multiplexed expansion bus timing diagram 5. this characteristic is affected by clock stretch. add n t cyc where n = 0, 1, 2, or 3, depending on the number of clock stretches. 6. without tag enabled. dbe 24 25 eclk r/w 1 2 3 18 11 12 14 note: measurement points shown are 20% and 70% of v dd 13 16 17 read write 23 lstrb 21 19 20 (w/o tag enabled) 5 7 22 8 15 address/data multiplexed address address data data 10 9 26
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 383 table 20-15. spi timing (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , 200 pf load on all spi pins) (1) num function symbol min max unit operating frequency master slave f op 1/256 1/256 1 / 2 1 / 2 f eclk 1 sck period master slave t sck 2 2 256 ? t cyc t cyc 2 enable lead time master slave t lead 1 / 2 1 ? ? t sck t cyc 3 enable lag time master slave t lag 1 / 2 1 ? ? t sck t cyc 4 clock (sck) high or low time master slave t wsck t cyc ? 30 t cyc ? 30 128 t cyc ? ns ns 5 sequential transfer delay master slave t td 1 / 2 1 ? ? t sck t cyc 6 data setup time (inputs) master slave t su 30 30 ? ? ns ns 7 data hold time (inputs) master slave t hi 0 30 ? ? ns ns 8 slave access time t a ? 1 t cyc 9 slave miso disable time t dis ? 1 t cyc 10 data valid (after sck edge) master slave t v ? ? 50 50 ns ns 11 data hold time (outputs) master slave t ho 0 0 ? ? ns ns 12 rise time input output t ri t ro ? ? t cyc ? 30 30 ns ns 13 fall time input output t fi t fo ? ? t cyc ? 30 30 ns ns 1. all ac timing is shown with respect to 20% v dd and 70% v dd levels unless otherwise noted.
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 384 electrical specifications motorola a) spi master timing (cpha = 0) b) spi master timing (cpha = 1) figure 20-11. spi timing diagram (1 of 2) sck (output) sck (output) miso (input) mosi (output) ss 1 (output) 1 10 6 7 msb in 2 bit 6 . . . 1 lsb in msb out 2 lsb out bit 6 . . . 1 11 4 4 2 10 (cpol = 0) (cpol = 1) 5 3 12 13 1. ss output mode (dds7 = 1, ssoe = 1). 2. lsbf = 0. for lsbf = 1, bit order is lsb, bit 1, ..., bit 6, msb. sck (output) sck (output) miso (input) mosi (output) 1 6 7 msb in 2 bit 6 . . . 1 lsb in master msb out 2 master lsb out bit 6 . . . 1 4 4 10 12 13 11 port data (cpol = 0) (cpol = 1) port data ss 1 (output) 5 2 13 12 3 1. ss output mode (dds7 = 1, ssoe = 1). 2. lsbf = 0. for lsbf = 1, bit order is lsb, bit 1, ..., bit 6, msb.
electrical specifications tables of data 68hc(9)12d60 ? rev 3.0 advance information motorola electrical specifications 385 a) spi slave timing (cpha = 0) b) spi slave timing (cpha = 1) figure 20-12. spi timing diagram (2 of 2) sck (input) sck (input) mosi (input) miso (output) ss (input) 1 10 6 7 msb in bit 6 . . . 1 lsb in msb out slave lsb out bit 6 . . . 1 11 4 4 2 8 (cpol = 0) (cpol = 1) 5 3 13 note: not defined but normally msb of character just received. slave 13 12 11 see 12 note 9 sck (input) sck (input) mosi (input) miso (output) 1 6 7 msb in bit 6 . . . 1 lsb in msb out slave lsb out bit 6 . . . 1 4 4 10 12 13 11 see (cpol = 0) (cpol = 1) ss (input) 5 2 13 12 3 note: not defined but normally lsb of character just received. slave note 8 9
electrical specifications advance information 68hc(9)12d60 ? rev 3.0 386 electrical specifications motorola table 20-16. cgm characteristics 5.0 volts 10% characteristic symbol min. typ. max. unit pll reference frequency, crystal oscillator range f ref 0.5 8 mhz bus frequency f bus 0.004 8 mhz vco range f vco 2.5 8 mhz vco limp-home frequency f vcomin 0.512.5mhz lock detector transition from acquisition to tracking mode (1) ? trk 3% 4% ? lock detection ? lock 0% 1.5% ? un-lock detection ? unl 0.5% 2.5% ? lock detector transition from tracking to acquisition mode (1) ? unt 6% 8% ? minimum leakage resistance on crystal oscillator pins r leak 1m ? pll stabilization delay (2) pll total stabilization delay (3) t stab 3ms pllon acquisition mode stabilization delay. (3) t acq 1ms pllon tracking mode stabilization delay. (3) t al 2ms 1. auto bit set 2. pll stabilization delay is highly dependent on operational requirement and external component values (i.e. crystal, xfc filter component values|). note (3) shows typical delay values for a typical configuration. appropriate xfc filter values should be chosen based on operational requirement of system. 3. f ref = 4mhz, f bus = 8mhz (refdv = #$00, synr = #$01), xfc:cs = 33nf, cp = 3.3nf, rs = 2.7k ? . table 20-17. key wake-up v dd = 5.0v dc 10% characteristic symbol min. max. unit stop key wake-up filter time t kwstp 210 s key wake-up single pulse time interval t kwsp 20 s table 20-18. mscan12 wake-up time from sleep mode v dd = 5.0v dc 10%, v ss = 0 vdc, t a = t l to t h, unless otherwise noted characteristic symbol min. max. unit wake-up time t wup 25 s
68hc(9)12d60 ? rev 3.0 advance information motorola appendix: cgm practical aspects 387 advance information ? 68hc(9)12d60 section 21. appendix: cgm practical aspects 21.1 contents 21.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 21.3 a few hints for the cgm crystal oscillator application. . . . 387 21.4 practical aspects for the pll usage . . . . . . . . . . . . . . . . . . 390 21.5 printed circuit board guidelines. . . . . . . . . . . . . . . . . . . . . . . 395 21.2 introduction this sections provides useful and practical pieces of information concerning the implementation of the cgm module. 21.3 a few hints for the cgm crystal oscillator application 21.3.1 what loading capacitors to choose? first, from small-signal analysis, it is known that relatively large values for c1 and c2 have a positive impact on the phase margin. however, the higher loading they represent decreases the loop gain. alternatively, small values for these capacitors will lead to higher open loop gain, but as the frequency of oscillation approaches the parallel resonance, the phase margin, and consequently the ability to start-up correctly, will decrease. from this it is clear that relatively large capacitor values (>33pf), are reserved for low frequency crystals in the mhz range. note: using the recommended loading capacitor cl value from the crystal manufacturer is a good starting point. taking into account unavoidable strays, this equates to about (cl-2pf).
appendix: cgm practical aspects advance information 68hc(9)12d60 ? rev 3.0 388 appendix: cgm practical aspects motorola theoretically speaking, nothing precludes the use of non-identical values for c1 and c2. as this complicate a bit the management of the final board device list, this is not recommended. however, if asymmetrical capacitors are chosen, the value of c1 should be higher than c2 (because the reflected loading is proportional to the square of the impedance of c2). 21.3.2 dc bias due to the nature of the translated ground colpitts oscillator a dc voltage bias is applied to the crystal. please contact the crystal manufacturer for specific dc bias conditions and recommended capacitance value (if applicable). 21.3.3 what is the final oscillation frequency? the exact calculation is not straightforward as it takes into account the resonator characteristics and the loading capacitors values as well as internal design parameters which can vary with process voltage temperature (pvt) conditions. nevertheless, if l is the series inductance, r is the series resistance, c is the series capacitance and cc the parallel capacitance of the crystal, we can then use the following simplified equation: 21.3.4 how do i control the peak to peak oscillation amplitude? the cgm oscillator is equipped with an amplitude limitation control loop which integrates the peak to peak ? extal ? amplitude and in return reduces the steady current of the transconductor device until a stable fosc 1 2 || () ? ? ?? ? () ? ?
appendix: cgm practical aspects a few hints for the cgm crystal oscillator application 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: cgm practical aspects 389 quiescent point is reached. controlling this final peak to peak amplitude can be performed by three means: 1. reducing the values of c1 and c2. this decreases the loading so that the necessary gm value required to sustain oscillation can be smaller. the consequently smaller current will be reached with a larger ? extal ? swing. 2. using vddpll=vss (i.e. shutting off the pll). doing so increases the starting current by approximately 50%. all other parameters staying the same, a larger ? extal ? swing will be required to reduce this starting current to its quiescent value. 3. also, placing a high value resistor (>1m ? ) across the extal and xtal pins significantly increased the oscillation amplitude. because this complicates the design analysis as it transforms a pure susceptance j c1 into a complex admittance g+j c1, motorola cannot promote this application trick. 21.3.5 what do i do in case the oscillator does not start-up? 1. first, verify that the application schematic respects the principle of operation, i.e. crystal mounted between extal and vss, capacitor c1 between xtal and extal, capacitor c2 between xtal and vss, nothing else. this is not the conventional mcu application schematic of the pierce oscillator as it can be seen on other hc12 derivatives! 2. re-consider the choice of the tuning capacitors. 3. the oscillator circuitry is powered internally from a core vdd pad and the return path is the vsspll pad. verify on the application pcb the correct connection of these pads (especially vsspll), but also verify the waveform of the vdd voltage as it is imposed on the pad. sometimes external components (for instance choke inductors), can cause oscillations on the power line. this is of course detrimental to the oscillator circuitry. 4. if possible, consider using a resonator with built-in tuning capacitors. they may offer better performances with respect to their discrete elements implementation.
appendix: cgm practical aspects advance information 68hc(9)12d60 ? rev 3.0 390 appendix: cgm practical aspects motorola 21.4 practical aspects for the pll usage 21.4.1 synthesized bus frequency starting from a ceramic resonator or quartz crystal frequency f xtal , if ? refdv ? and ? synr ? are the decimal content of the refdv and synr registers respectively, then the mcu bus frequency will simply be: note: it is not allowed to synthesize a bus frequency that is lower than the crystal frequency, as the correct functioning of some internal synchronizers would be jeopardized (e.g. the mclk and xclk clock generators). 21.4.2 operation under adverse environmental conditions the normal operation for the pll is the so-called ? automatic bandwidth selection mode ? which is obtained by having the auto bit set in the pllcr register. when this mode is selected and as the vco frequency approaches its target, the charge pump current level will automatically switch from a relatively high value of around 40 a to a lower value of about 3 a. it can happen that this low level of charge pump current is not enough to overcome leakages present at the xfc pin due to adverse environmental conditions. these conditions are frequently encountered for uncoated pcbs in automotive applications. the main symptom for this failure is an unstable characteristic of the pll which in fact ? hunts ? between acquisition and tracking modes. it is then advised for the running software to place the pll in manual, forced acquisition mode by clearing both the auto and the acq bits in the pllcr register. doing so will maintain the high current level in the charge pump constantly and will permit to sustain higher levels of leakages at the xfc pin. this latest revision of the clock generator module maintains the lock detection f bus f vco f xtal synr 1 + () ? () { {
appendix: cgm practical aspects practical aspects for the pll usage 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: cgm practical aspects 391 feature even in manual bandwidth control, offering then to the application software the same flexibility for the clocking control as the automatic mode. 21.4.3 filter components selection guide 21.4.3.1 equations set these equations can be used to select a set of filter components. two cases are considered: 1. the ? tracking ? mode. this situation is reached normally when the pll operates in automatic bandwidth selection mode (auto=1 in the pllcr register). 2. the ? acquisition ? mode. this situation is reached when the pll operates in manual bandwidth selection mode and forced acquisition (auto=0, acq =0 in the pllcr register). in both equations, the power supply should be 5v. start with the target loop bandwidth as a function of the other parameters, but obviously, nothing prevents the user from starting with the capacitor value for example. also, remember that the smoothing capacitor is always assumed to be one tenth of the series capacitance value. so with: m: the multiplying factor for the reference frequency (i.e. (synr+1)) r: the series resistance of the low pass filter in ? c: the series capacitance of the low pass filter in nf f bus : the target bus frequency expressed in mhz : the desired damping factor f c : the desired loop bandwidth expressed in hz for the ? tracking ? mode: f c 210 9 ?? ?? ?? ?? ?? ??
appendix: cgm practical aspects advance information 68hc(9)12d60 ? rev 3.0 392 appendix: cgm practical aspects motorola and for the ? acquisition ? mode: 21.4.3.2 particular case of an 8mhz synthesis assume that a desired value for the damping factor of the second order system is close to 0.9 as this leads to a satisfactory transient response. then, derived from the equations above, table 21-1 and table 21-2 suggest sets of values corresponding to several loop bandwidth possibilities in the case of an 8mhz synthesis for the two cases mentioned above. the filter components values are chosen from standard series (e.g. e12 for resistors). the operating voltage is assumed to be 5v (although there is only a minor difference between 3v and 5v operation). the smoothing capacitor cp in parallel with r 0 and c 0 is set to be 1/10 of the value of c 0 . the reference frequencies mentioned in this table correspond to the output of the fine granularity divider controlled by the refdv register. this means that the calculations are irrespective of the way the reference frequency is generated (directly for the crystal oscillator or after division). the target frequency value also has an influence on the calculations of the filter components because the vco gain is not constant over its operating range. the bandwidth limit corresponds to the so-called gardner ? s criteria. it corresponds to the maximum value that can be chosen before the continuous time approximation ceases to be justified. it is of course advisable to stay far away from this limit. f c 210 9 ?? ?? 10.795 ----------------------------- ?? ?? r ?? 2 m ?? -------------------------------------------------------- - ==
appendix: cgm practical aspects practical aspects for the pll usage 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: cgm practical aspects 393 table 21-1. suggested 8mhz synthesis pll filter elements (tracking mode) reference [mhz] synr fbus [mhz] c 0 [nf] r 0 [k ? ]c p [nf] loop bandwidth [khz] bandwidth limit [khz] 0.614 $0c 7.98 100 4.3 10 1.1 157 0.614 $0c 7.98 4.7 20 0.47 5.3 157 0.614 $0c 7.98 1.0 43 0.1 11.5 157 0.614 $0c 7.98 0.33 75 0.033 20 157 0.8 $09 8.00 220 2.7 22 0.9 201 0.8 $09 8.00 10 12 1.0 4.2 201 0.8 $09 8.00 2.2 27 0.22 8.6 201 0.8 $09 8.00 0.47 56 0.047 19.2 201 1 $07 8.00 220 2.4 22 1 251 1 $07 8.00 10 11 1.0 4.7 251 1 $07 8.00 2.2 24 0.22 9.9 251 1 $07 8.00 0.47 51 0.047 21.4 251 1.6 $05 8.00 330 1.5 33 1 402 1.6 $05 8.00 10 9.1 1.0 5.9 402 1.6 $05 8.00 3.3 15 0.33 10.2 402 1.6 $05 8.00 1.0 27 0.1 18.6 402 2 $03 8.00 470 1.1 47 0.96 502 2 $03 8.00 22 5.1 2.2 4.4 502 2 $03 8.00 4.7 11 0.47 9.6 502 2 $03 8.00 1.0 24 0.1 20.8 502 2.66 $02 8.00 220 1.5 22 1.6 668 2.66 $02 8.00 22 4.7 2.2 5.1 668 2.66 $02 8.00 4.7 10 0.47 11 668 2.66 $02 8.00 1.0 22 0.1 24 668 4 $01 8.00 220 1.2 22 1.98 1005 4 $01 8.00 33 3 3.3 5.1 1005 4 $01 8.00 10 5.6 1.0 9.3 1005 4 $01 8.00 2.2 12 0.22 19.8 1005
appendix: cgm practical aspects advance information 68hc(9)12d60 ? rev 3.0 394 appendix: cgm practical aspects motorola table 21-2. suggested 8mhz synthesis pll filter elements (acquisition mode) reference [mhz] synr fbus [mhz] c 0 [nf] r 0 [k ? ]c p [nf] loop bandwidth [khz] bandwidth limit [khz] 0.614 $0c 7.98 1000 0.43 100 1.2 157 0.614 $0c 7.98 47 2 4.7 5.5 157 0.614 $0c 7.98 10 4.3 1.0 12 157 0.614 $0c 7.98 3.3 7.5 0.33 21 157 0.8 $09 8.00 2200 0.27 220 0.9 201 0.8 $09 8.00 100 1.2 10 4.4 201 0.8 $09 8.00 22 2.4 2.2 9.3 201 0.8 $09 8.00 4.7 5.6 0.47 20.1 201 1 $07 8.00 2200 0.22 220 1 251 1 $07 8.00 100 1.0 10 4.8 251 1 $07 8.00 2. 2.2 2.2 10.4 251 1 $07 8.00 4.7 4.7 0.47 22.5 251 1.6 $05 8.00 3300 0.15 330 1.1 402 1.6 $05 8.00 100 0.82 10 6.2 402 1.6 $05 8.00 33 1.5 3.3 10.7 402 1.6 $05 8.00 10 2.7 1.0 19.5 402 2 $03 8.00 4700 0.1 470 1 502 2 $03 8.00 220 0.51 22 4.6 502 2 $03 8.00 47 1.0 4.7 10 502 2 $03 8.00 10 2.4 1.0 21.8 502 2.66 $02 8.00 2200 0.12 220 1.7 668 2.66 $02 8.00 220 0.43 22 5.3 668 2.66 $02 8.00 47 1.0 4.7 11.6 668 2.66 $02 8.00 10 2 1.0 25.1 668 4 $01 8.00 2200 0.1 220 2.1 1005 4 $01 8.00 330 0.27 33 5.4 1005 4 $01 8.00 100 0.51 10 9.7 1005 4 $01 8.00 22 1.0 2.2 20.8 1005
appendix: cgm practical aspects printed circuit board guidelines 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: cgm practical aspects 395 21.5 printed circuit board guidelines printed circuit boards (pcbs) are the board of choice for volume applications. if designed correctly, a very low noise system can be built on a pcb with consequently good emi/emc performances. if designed incorrectly, pcbs can be extremely noisy and sensitive modules, and the cgm could be disrupted. some common sense rules can be used to prevent such problems.  use a ? star ? style power routing plan as opposed to a ? daisy chain ? . route power and ground from a central location to each chip individually, and use the widest trace practical (the more the chip draws current, the wider the trace). never place the mcu at the end of a long string of serially connected chips.  when using pcb layout software, first direct the routing of the power supply lines as well as the cgm wires (crystal oscillator and pll). layout constraints must be then reported on the other signals and not on these ? hot ? nodes. optimizing the ? hot ? nodes at the end of the routing process usually gives bad results.  avoid notches in power traces. these notches not only add resistance (and are not usually accounted for in simulations), but they can also add unnecessary transmission line effects.  avoid ground and power loops. this has been one of the most violated guidelines of pcb layout. loops are excellent noise transmitters and can be easily avoided. when using multiple layer pcbs, the power and ground plane concept works well but only when strictly adhered to (do not compromise the ground plane by cutting a hole in it and running signals on the ground plane layer). keep the spacing around via holes to a minimum (but not so small as to add capacitive effects).  be aware of the three dimensional capacitive effects of multi- layered pcbs.  bypass (decouple) the power supplies of all chips as close to the chip as possible. use one decoupling capacitor per power supply pair (vdd/vss, vddx/vssx...). two capacitors with a ratio of about 100 sometimes offer better performances over a broader
appendix: cgm practical aspects advance information 68hc(9)12d60 ? rev 3.0 396 appendix: cgm practical aspects motorola spectrum. this is especially the case for the power supply pins close to the e port, when the e clock and/or the calibration clock are used.  on the general vdd power supply input, a ? t ? low pass filter lcl can be used (e.g. 10 h-47 f-10 h). the ? t ? is preferable to the ? ? version as the exhibited impedance is more constant with respect to the vdd current. like many modular micro controllers, hc12 devices have a power consumption which not only varies with clock edges but also with the functioning modes.  keep high speed clock and bus trace length to a minimum. the higher the clock speed, the shorter the trace length. if noisy signals are sent over long tracks, impedance adjustments should be considered at both ends of the line (generally, simple resistors suffice).  bus drivers like the can physical interface should be installed close to their connector, with dedicated filtering on their power supply.  mount components as close to the board as possible. snip excess lead length as close to the board as possible. preferably use surface mount devices (smds).  mount discrete components as close to the chip that uses them as possible.  do not cross sensitive signals on any layer. if a sensitive signal must be crossed by another signal, do it as many layers away as possible and at right angles.  always keep pcbs clean. solder flux, oils from fingerprints, humidity and general dirt can conduct electricity. sensitive circuits can easily be disrupted by small amounts of leakage.  choose pcb coatings with care. certain epoxies, paints, gelatins, plastics and waxes can conduct electricity. if the manufacturer cannot provide the electrical characteristics of the substance, do not use it.
appendix: cgm practical aspects printed circuit board guidelines 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: cgm practical aspects 397 in addition to the above general pieces of advice, the following guidelines should be followed for the cgm pins (but also more generally for any sensitive analog circuitry):  parasitic capacitance on extal is absolutely critical ? probably the most critical layout consideration. the xtal pin is not as sensitive. all routing from the extal pin through the resonator and the blocking cap to the actual connection to vss must be considered.  for minimum capacitance there should ideally be no ground / power plane around the extal pin and associated routing. however, practical emc considerations obviously should be taken into consideration for each application.  the clock input circuitry is sensitive to noise so excellent supply routing and decoupling is mandatory. connect the ground point of the oscillator circuit directly to the vsspll pin.  good isolation of pll / oscillator power supply is critical. use 1nf+ 100nf and keep tracks as low impedance as possible  load capacitors should be low leakage and stable across temperature ? use npo or c0g types.  the load capacitors may ? pull ? the target frequency by a few ppm. crystal manufacturer specs show symmetrical values but the series device capacitance on extal and xtal are not symmetrical. it may be possible to adjust this by changing the values of the load capacitors ? start-up conditions should be evaluated.  keep the adjacent port h / port e and reset signals noise free. don ? t connect these to external signals and / or add series filtering ? a series resistor is probably adequate.  any dc-blocking capacitor should be as low esr as possible ? for the range of crystals we are looking at anything over 1 ohm is too much.  mount oscillator components on mcu side of board ? avoid using vias in the oscillator circuitry.
appendix: cgm practical aspects advance information 68hc(9)12d60 ? rev 3.0 398 appendix: cgm practical aspects motorola  mount the pll filter and oscillator components as close to the mcu as possible.  do not allow the extal and xtal signals to interfere with the xfc node. keep these tracks as short as possible.  do not cross the cgm signals with any other signal on any level.  remember that the reference voltage for the xfc filter is vddpll.  as the return path for the oscillator circuitry is vsspll, it is extremely important to connect vsspll to vss even if the pll is not to be powered. surface mount components reduce the susceptibility of signal contamination.  ceramic resonators with built-in capacitors are available. this is an interesting solution because the parasitic components involved are minimized due to the close proximity of the resonating elements.
68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a flash eeprom 399 advance information ? 68hc(9)12d60 section 22. appendix: 68hc912d60a flash eeprom 22.1 contents 22.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 22.3 overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 22.4 flash eeprom control block . . . . . . . . . . . . . . . . . . . . . . . . 400 22.5 flash eeprom arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 22.6 flash eeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 22.7 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .403 22.8 programming the flash eeprom . . . . . . . . . . . . . . . . . . . . . 404 22.9 erasing the flash eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . 405 22.10 stop or wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .405 22.2 introduction the two flash eeprom modules (32-kbyte and 28-kbyte) for the 68hc912d60a serve as electrically erasable and programmable, non- volatile rom emulation memory. the modules can be used for program code that must either execute at high speed or is frequently executed, such as operating system kernels and standard subroutines, or they can be used for static data which is read frequently. the flash eeprom is ideal for program storage for single-chip applications allowing for field reprogramming.
appendix: 68hc912d60a flash eeprom advance information 68hc(9)12d60 ? rev 3.0 400 appendix: 68hc912d60a flash eeprom motorola 22.3 overview the flash eeprom array is arranged in a 16-bit configuration and may be read as either bytes, aligned words or misaligned words. access time is one bus cycle for byte and aligned word access and two bus cycles for misaligned word operations. programming is by aligned word. the flash eeprom module supports bulk erase only. each flash eeprom module has hardware interlocks which protect stored data from accidental corruption. an erase- and program- protected 8-kbyte block for boot routines is located at $6000 ? $7fff or $e000 ? $ffff depending upon the mapped location of the flash eeprom arrays. 22.4 flash eeprom control block a 4-byte register block for each module controls the flash eeprom operation. configuration information is specified and programmed independently from the contents of the flash eeprom array. at reset, the 4-byte register section starts at address $00f4/$00f8. 22.5 flash eeprom arrays after reset, the 32k flash eeprom array is located from addresses $8000 to $ffff and the 28k flash eeprom array is from $1000 to $7fff. in expanded modes, the flash eeprom arrays are turned off. the flash eeprom can be mapped to an alternate address range. see operating modes and resource mapping .
appendix: 68hc912d60a flash eeprom flash eeprom registers 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a flash eeprom 401 22.6 flash eeprom registers in normal modes the lock bit can only be written once after reset. lock ? lock register bit 0 = enable write to feemcr register 1 = disable write to feemcr register this register controls the operation of the flash eeprom array. bootp cannot be changed when the lock control bit in the feelck register is set or if enpe in the feectl register is set. bootp ? boot protect the boot blocks are located at $6000 ? $7fff and $e000 ? $ffff for each flash eeprom module. 0 = enable erase and program of 8k byte boot block 1 = disable erase and program of 8k byte boot block this register controls the programming and erasure of the flash eeprom. fee32lck/fee28lck ? flash eeprom lock control register $00f4/$00f8 bit 7 6 5 4 3 2 1 bit 0 0 0 0 0 0 0 0 lock reset: 0 0 0 0 0 0 0 0 fee32mcr/fee28mcr ? flash eeprom module configuration register $00f5/$00f9 bit 7 6 5 4 3 2 1 bit 0 0 0 0 0 0 0 0 bootp reset: 0 0 0 0 0 0 0 1 fee32ctl/fee28ctl ? flash eeprom control register $00f7/$00fb bit 7 6 5 4 3 2 1 bit 0 0 0 0 feeswai hven 0 eras pgm reset: 0 0 0 0 0 0 0 0
appendix: 68hc912d60a flash eeprom advance information 68hc(9)12d60 ? rev 3.0 402 appendix: 68hc912d60a flash eeprom motorola feeswai ? flash eeprom stop in wait control 0 = do not halt flash eeprom clock when the part is in wait mode. 1 = halt flash eeprom clock when the part is in wait mode. hven ? high-voltage enable this bit enables the charge pump to supply high voltages for program and erase operations in the array. hven can only be set if either pgm or eras are set and the proper sequence for program or erase is followed. 0 = disables high voltage to array and charge pump off 1 = enables high voltage to array and charge pump on eras ? erase control this bit configures the memory for erase operation. eras is interlocked with the pgm bit such that both bits cannot be equal to 1 or set to1 at the same time. 0 = erase operation is not selected. 1 = erase operation selected. pgm ? program control this bit configures the memory for program operation. pgm is interlocked with the eras bit such that both bits cannot be equal to 1 or set to1 at the same time. 0 = program operation is not selected. 1 = program operation selected.
appendix: 68hc912d60a flash eeprom operation 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a flash eeprom 403 22.7 operation the flash eeprom can contain program and data. on reset, it can operate as a bootstrap memory to provide the cpu with internal initialization information during the reset sequence. 22.7.1 bootstrap operation single-chip mode after reset, the cpu controlling the system will begin booting up by fetching the first program address from address $fffe. 22.7.2 normal operation the flash eeprom allows a byte or aligned word read in one bus cycle. misaligned word read require an additional bus cycle. the flash eeprom array responds to read operations only. write operations are ignored. 22.7.3 program/erase operation an unprogrammed flash eeprom bit has a logic state of one. a bit must be programmed to change its state from one to zero. erasing a bit returns it to a logic one. the flash eeprom has a minimum program/erase life of 100 cycles. programming or erasing the flash eeprom is accomplished by a series of control register writes. programming is restricted to aligned word at a time as determined by internal signal sz8 and addr[0]. the flash eeprom must first be completely erased prior to programming final data values. programming and erasing of flash locations cannot be performed by code being executed from the flash memory. while these operations must be performed in the order shown, other unrelated operations may occur between the steps. do not exceed t fpgm maximum (40 s).
appendix: 68hc912d60a flash eeprom advance information 68hc(9)12d60 ? rev 3.0 404 appendix: 68hc912d60a flash eeprom motorola 22.8 programming the flash eeprom programming the flash eeprom is done on a row basis. a row consists of 64 consecutive bytes starting from addresses $xx00, $xx40, $xx80 and $xxc0. use this step-by-step procedure to program a row of flash memory. 1. set the pgm bit. this configures the memory for program operation and enables the latching of address and data for programming. 2. write to any flash address with any data within the row address range desired. 3. wait for a time, t nvs (min. 10 s). 4. set the hven bit. 5. wait for a time, t pgs (min. 5 s). 6. write to the flash address with data to the word desired to be programmed. if bootp is asserted, an attempt to program an address in the boot block will be ignored. 7. wait for a time, t fpgm (min. 30 s). 8. repeat steps 6 and 7 until all the words within the row are programmed. 9. clear the pgm bit. 10. wait for a time, t nvh (min. 5 s). 11. clear the hven bit. 12. after time, t rcv (min 1 s), the memory can be accessed in read mode again. this program sequence is repeated throughout the memory until all data is programmed. for minimum overall programming time and least program disturb effect, the sequence should be part of an intelligent operation which iterates per row.
appendix: 68hc912d60a flash eeprom advance information 68hc(9)12d60 ? rev 3.0 405 appendix: 68hc912d60a flash eeprom motorola 22.9 erasing the flash eeprom the following sequence demonstrates the recommended procedure for erasing any of the flash eeprom array. 1. set the eras bit. 2. write to any valid address in the flash array. the data written and the address written are not important. the boot block will be erased only if the control bit bootp is negated. 3. wait for a time, t nvs (min. 10 s). 4. set the hven bit. 5. wait for a time, t eras (min. 8ms). 6. clear the eras bit. 7. wait for a time, t nvhl (min. 100 s). 8. clear the hven bit. 9. after time, t rcv (min 1 s), the memory can be accessed in read mode again. 22.10 stop or wait mode when stop or wait commands are executed, the mcu puts the flash eeprom in stop or wait mode. in these modes the flash module will cease erasure or programming immediately. caution: it is advised not to enter stop or wait modes when program or erase operation of the flash array is in progress.
appendix: 68hc912d60a flash eeprom advance information 68hc(9)12d60 ? rev 3.0 406 appendix: 68hc912d60a flash eeprom motorola
68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a eeprom 407 advance information ? 68hc(9)12d60 section 23. appendix: 68hc912d60a eeprom 23.1 contents 23.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 23.3 eeprom programmer ? s model . . . . . . . . . . . . . . . . . . . . . . . 408 23.4 eeprom control registers . . . . . . . . . . . . . . . . . . . . . . . . . . 409 23.5 program/erase operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 23.6 shadow word mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . .415 23.7 programming eedivh and eedivl registers. . . . . . . . . . . . 416 23.2 introduction the 68hc912d60a eeprom nonvolatile memory is arranged in a 16- bit configuration. the eeprom array may be read as either bytes, aligned words or misaligned words. access times are one bus cycle for byte and aligned word access and two bus cycles for misaligned word operations. programming is by byte or aligned word. attempts to program or erase misaligned words will fail. only the lower byte will be latched and programmed or erased. programming and erasing of the user eeprom can be done in normal modes. each eeprom byte or aligned word must be erased before programming. the eeprom module supports byte, aligned word, row (32 bytes) or bulk erase, all using the internal charge pump. the erased state is $ff. the eeprom module has hardware interlocks which protect stored data from corruption by accidentally enabling the program/erase voltage. programming voltage is derived from the internal v dd supply with an internal charge pump.
appendix: 68hc912d60a eeprom advance information 68hc(9)12d60 ? rev 3.0 408 appendix: 68hc912d60a eeprom motorola 23.3 eeprom programmer ? s model the eeprom module consists of two separately addressable sections. the first is an eight-byte memory mapped control register block used for control, testing and configuration of the eeprom array. the second section is the eeprom array itself. at reset, the eight-byte register section starts at address $00ec and the eeprom array is located from addresses $0c00 to $0fff. registers $00ec-$00ed are reserved. read/write access to the memory array section can be enabled or disabled by the eeon control bit in the initee register ($0012). this feature allows the access of memory mapped resources that have lower priority than the eeprom memory array. eeprom control registers can be accessed regardless of the state of eeon. for information on re- mapping the register block and eeprom address space, refer to operating modes and resource mapping . caution: it is strongly recommended to discontinue program/erase operations during wait (when eeswai=1) or stop modes since all program/erase activities will be terminated abruptly and considered unsuccessful. for lowest power consumption during wait mode, it is advised to turn off eepgm. the eeprom module contains an extra word called shadow word which is loaded at reset into the eemcr, eedivh and eedivl registers. to program the shadow word, when in special modes (smodn=0), the noshw bit in eemcr register must be cleared. normal programming routines are used to program the shadow word which becomes accessible at address $0fc0-$0fc1 when noshw is cleared. at the next reset the shadow word data is loaded into the eemcr, eedivh and eedivl registers. the shadow word can be protected from being programmed or erased by setting the shprot bit of eeprot register.
appendix: 68hc912d60a eeprom eeprom control registers 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a eeprom 409 a steady internal self-time clock is required to provide accurate counts to meet eeprom program/erase requirements. this clock is generated via a programmable 10-bit prescaler register. automatic program/erase termination is also provided. in ordinary situations, with crystal operating properly, the steady internal self-time clock is derived from the input clock source (extali). the divider value is as in eedivh:eedivl. in limp-home mode, where the oscillator clock has malfunctioned or is unavailable, the self-time clock is derived from the pll with approximately 1 mhz frequency, with a predefined divider value of $0023. program/erase operation is not guaranteed in limp-home mode. the clock switching function is only applicable for permanent loss of crystal condition, so the program/erase will also not be guaranteed when the loss of crystal condition is intermittent. it is strongly recommended that the clock monitor is enabled to ensure that the program/erase operation will be shutdown in the event of loss of crystal with a clock monitor reset, or switch to a limp-home mode clock. this will prevent unnecessary stress on the emulated eeprom during oscillator failure. 23.4 eeprom control registers eedivh ? eeprom modulus divider $00ee bit 7654321bit 0 000000eediv9eediv8 reset: 0 0 0 0 0 0 ? (1) ? (1) 1. loaded from shadow word. eedivl ? eeprom modulus divider $00ef bit 7654321bit 0 eediv7 eediv6 eediv5 eediv4 eediv3 eediv2 eediv1 eediv0 reset: ? (1) ? (1) ? (1) ? (1) ? (1) ? (1) ? (1) ? (1) 1. loaded from shadow word.
appendix: 68hc912d60a eeprom advance information 68hc(9)12d60 ? rev 3.0 410 appendix: 68hc912d60a eeprom motorola eediv[9:0] ? prescaler divider loaded from shadow word at reset. read anytime. write once in normal modes (smodn =1) if eelat = 0 and anytime in special modes (smodn =0) if eelat = 0. the prescaler divider is required to produce a self-time clock with a fixed frequency around 28.6 khz for the range of oscillator frequencies. the divider is set so that the oscillator frequency can be divided by a divide factor that can produce a 35 s +/- 2 s pulse. caution: an incorrect or uninitialized value on eediv can result in overstress of eeprom array during program/erase operation. it is also strongly recommend not to program eeprom with oscillator frequencies less than 250 khz. the eediv value is determined by the following formula: note: int[a] denotes the round down integer value of a. program/erase cycles will not be activated when eediv = 0. eediv int extali (hz) x 35 6 ? 10 0.5 + [] = table 23-1. eediv selection osc freq. osc period divide factor eediv 16 mhz 62.5ns 560 $0230 8 mhz 125ns 280 $0118 4 mhz 250ns 140 $008c 2 mhz 500ns 70 $0046 1 mhz 1 s 35 $0023 500 khz 2 s 18 $0012 250 khz 4 s 9 $0009 eemcr ? eeprom module configuration $00f0 bit 7654321bit 0 nobdml noshw reserved (1) 1 eeswai protlck dmy reset: ? (2) ? (2) ? (2) ? (2) 1100 1. bits 4 and 5 have test functions and should not be programmed. 2. loaded from shadow word.
appendix: 68hc912d60a eeprom eeprom control registers 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a eeprom 411 bits[7:4] are loaded at reset from the eeprom shadow word. note: the bits 5 and 4 are reserved for test purposes. these locations in shadow word should not be programmed otherwise some locations of regular eeprom array will not be visible. nobdml ? background debug mode lockout disable 0 = the bdm lockout is enabled. 1 = the bdm lockout is disabled. loaded from shadow word at reset. read anytime. write anytime in special modes (smodn=0). noshw ? shadow word disable 0 = the shadow word is enabled and accessible at address $0fc0-$0fc1. 1 = regular eeprom array at address $0fc0-$0fc1. loaded from shadow word at reset. read anytime. write anytime in special modes (smodn=0). when noshw cleared, the regular eeprom array bytes at address $0fc0 and $0fc1 are not visible. the shadow word is accessed instead for both read and program/erase operations. bits[7:4] from the high byte of the shadow word, $0fc0, are loaded to eemcr[7:4]. bits[1:0] from the high byte of the shadow word, $0fc0,are loaded to eedivh[1:0]. bits[7:0] from the low byte of the shadow word, $0fc1,are loaded to eedivl[7:0]. bulk program/erase only applies if shadow word is enabled. note: bit 6 from high byte of shadow word should not be programmed in order to have the full eeprom array visible. eeswai ? eeprom stops in wait mode 0 = the module is not affected during wait mode 1 = the module ceases to be clocked during wait mode read and write anytime. note: the eeswai bit should be cleared if the wait mode vectors are mapped in the eeprom array.
appendix: 68hc912d60a eeprom advance information 68hc(9)12d60 ? rev 3.0 412 appendix: 68hc912d60a eeprom motorola protlck ? block protect write lock 0 = block protect bits and bulk erase protection bit can be written 1 = block protect bits are locked read anytime. write once in normal modes (smodn = 1), set and clear any time in special modes (smodn = 0). dmy ? dummy bit read and write anytime. prevents accidental writes to eeprom. read anytime. write anytime if eepgm = 0 and protlck = 0. shprot ? shadow word protection 0 = the shadow word can be programmed and erased. 1 = the shadow word is protected from being programmed and erased. bprot[5:0] ? eeprom block protection 0 = associated eeprom block can be programmed and erased. 1 = associated eeprom block is protected from being programmed and erased. eeprot ? eeprom block protect $00f1 bit 7654321bit 0 shprot 1 bprot5 bprot4 bprot3 bprot2 bprot1 bprot0 reset: 1 1 1 1 1 1 1 1 table 23-22. k byte eeprom block protection bit name block protected block size bprot5 $0800 to $0bff 1024 bytes bprot4 $0c00 to $0dff 512 bytes bprot3 $0e00 to $0eff 256 bytes bprot2 $0f00 to $0f7f 128 bytes bprot1 $0f80 to $0fbf 64 bytes bprot0 $0fc0 to $0fff 64 bytes
appendix: 68hc912d60a eeprom eeprom control registers 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a eeprom 413 . bulkp ? bulk erase protection 0 = eeprom can be bulk erased. 1 = eeprom is protected from being bulk or row erased. read anytime. write anytime if eepgm = 0 and protlck = 0. auto ? automatic shutdown of program/erase operation. eepgm is cleared automatically after the program/erase cycles are finished when auto is set. 0 = automatic clear of eepgm is disabled. 1 = automatic clear of eepgm is enabled. read anytime. write anytime if eepgm = 0. byte ? byte and aligned word erase 0 = bulk or row erase is enabled. 1 = one byte or one aligned word erase only. read anytime. write anytime if eepgm = 0. row ? row or bulk erase (when byte = 0) 0 = erase entire eeprom array. 1 = erase only one 32-byte row. read anytime. write anytime if eepgm = 0. byte and row have no effect when erase = 0 if byte = 1 only the location specified by the address written to the programming latches will be erased. the operation will be a byte or an aligned word erase depending on the size of written data. eeprog ? eeprom control $00f3 bit 7654321bit 0 bulkp 0 auto byte row erase eelat eepgm reset:10000000 table 23-3. erase selection byte row block size 0 0 bulk erase entire eeprom array 0 1 row erase 32 bytes 1 0 byte or aligned word erase 1 1 byte or aligned word erase
appendix: 68hc912d60a eeprom advance information 68hc(9)12d60 ? rev 3.0 414 appendix: 68hc912d60a eeprom motorola erase ? erase control 0 = eeprom configuration for programming. 1 = eeprom configuration for erasure. read anytime. write anytime if eepgm = 0. configures the eeprom for erasure or programming. unless bulkp is set, erasure is by byte, aligned word, row or bulk. eelat ? eeprom latch control 0 = eeprom set up for normal reads. 1 = eeprom address and data bus latches set up for programming or erasing. read anytime. write anytime except when eepgm = 1 or eediv = 0. byte, row, erase and eelat bits can be written simultaneously or in any sequence. eepgm ? program and erase enable 0 = disables program/erase voltage to eeprom. 1 = applies program/erase voltage to eeprom. the eepgm bit can be set only after eelat has been set. when eelat and eepgm are set simultaneously, eepgm remains clear but eelat is set. the bulkp, auto, byte, row, erase and eelat bits cannot be changed when eepgm is set. to complete a program or erase cycle when auto bit is clear, two successive writes to clear eepgm and eelat bits are required before reading the programmed data. when auto bit is set, eepgm is automatically cleared after the program or erase cycle is over. a write to an eeprom location has no effect when eepgm is set. latched address and data cannot be modified during program or erase.
appendix: 68hc912d60a eeprom program/erase operation 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a eeprom 415 23.5 program/erase operation a program or erase operation should follow the sequence below if auto bit is clear: 1. write byte, row and erase to desired value, write eelat = 1 2. write a byte or an aligned word to an eeprom address 3. write eepgm = 1 4. wait for programming, t prog or erase, t erase delay time (10ms) 5. write eepgm = 0 6. write eelat = 0 if auto bit is set, steps 4 and 5 can be replaced by a step to poll the eepgm bit until is cleared. it is possible to program/erase more bytes or words without intermediate eeprom reads, by jumping from step 5 to step 2. 23.6 shadow word mapping the shadow word is mapped to location $_fc0 and $_fc1 when the noshw bit in eemcr register is zero. the value in the shadow word is loaded to the eemcr, eedivh and eedivl after reset. table 23-4 shows the mapping of each bit from shadow word to the registers table 23-4. shadow word mapping shadow word location register / bit $_fc0 bit 7 eemcr / nobdml $_fc0, bit 6 eemcr / noshw $_fc0, bit 5 eemcr / bit 5 (1) 1. reserved for testing. must be set to one in user application. $_fc0, bit 4 eemcr / bit 4 (1) $_fc0, bit 3:2 not mapped (2)) 2. reserved. must be set to one in user application for future compatibility. $_fc0, bit 1:0 eedivh / bit 1:0 $_fc1, bit 7:0 eemcr / bit 7:0
appendix: 68hc912d60a eeprom advance information 68hc(9)12d60 ? rev 3.0 416 appendix: 68hc912d60a eeprom motorola 23.7 programming eedivh and eedivl registers the eedivh and eedivl registers must be correctly set according to the oscillator frequency before any eeprom location can be programmed or erased. 23.7.1 normal mode the eedivh and eedivl registers are write once in normal mode. upon system reset, the application program is required to write correct divider value to eedivh and eedivl registers based on the oscillator frequency. after the first write, the value in the eedivh and eedivl registers is locked from been overwritten until the next reset. the eeprom is then ready for standard program/erase routines. caution: runaway code can possibly corrupt the eedivh and eedivl registers if they are not initialized for the write once. 23.7.2 special mode if an existing application code with eeprom program/erase routines is already fixed and the system is already operating at a known oscillator frequency, it is recommended to initialize the shadow word with the corresponding eedivh and eedivl values in special mode. the shadow word initializes eedivh and eedivl registers upon system reset to ensure software compatibility with existing code. initializing the eedivh and eedivl registers in special modes (smodn=0) is accomplished by the following steps. 1. write correct divider value to eedivh and eedivl registers based on the oscillator frequency as per table17. 2. remove the shadow word protection by clearing shprot bit in eeprot register. 3. clear noshw bit in eemcr register to make the shadow word visible at $0fc0-$0fc1. 4. write noshw bit in eemcr register to make the shadow word visible at $0fc0-$0fc1.
appendix: 68hc912d60a eeprom programming eedivh and eedivl registers 68hc(9)12d60 ? rev 3.0 advance information motorola appendix: 68hc912d60a eeprom 417 5. program bits 1 and 0 of the high byte of the shadow word and bits 7 to 0 of the low byte of the shadow word like a regular eeprom location at address $0fc0 and $0fc1. do not program other bits of the high byte of the shadow word (location $0fc0); otherwise some regular eeprom array locations will not be visible. at the next reset, the shadow values are loaded into the eedivh and eedivl registers. they do not require further initialization as long as the oscillator frequency of the target application is not changed. 6. protect the shadow word by setting shprot bit in eeprot register.
appendix: 68hc912d60a eeprom advance information 68hc(9)12d60 ? rev 3.0 418 appendix: 68hc912d60a eeprom motorola
68hc(9)12d60 ? rev 3.0 advance information motorola glossary 419 advance information ? 68hc(9)12d60 glossary a ? see ? accumulator (a). ? accumulator (a) ? an 8-bit general-purpose register in the cpu08. the cpu08 uses the accumulator to hold operands and results of arithmetic and logic operations. acquisition mode ? a mode of pll operation during startup before the pll locks on a frequency. also see "tracking mode." address bus ? the set of wires that the cpu or dma uses to read and write memory locations. addressing mode ? the way that the cpu determines the operand address for an instruction. the m68hc08 cpu has 16 addressing modes. alu ? see ? arithmetic logic unit (alu). ? arithmetic logic unit (alu) ? the portion of the cpu that contains the logic circuitry to perform arithmetic, logic, and manipulation operations on operands. asynchronous ? refers to logic circuits and operations that are not synchronized by a common reference signal. baud rate ? the total number of bits transmitted per unit of time. bcd ? see ? binary-coded decimal (bcd). ? binary ? relating to the base 2 number system. binary number system ? the base 2 number system, having two digits, 0 and 1. binary arithmetic is convenient in digital circuit design because digital circuits have two permissible voltage levels, low and high. the binary digits 0 and 1 can be interpreted to correspond to the two digital voltage levels. binary-coded decimal (bcd) ? a notation that uses 4-bit binary numbers to represent the 10 decimal digits and that retains the same positional structure of a decimal number. for example, 234 (decimal) = 0010 0011 0100 (bcd) bit ? a binary digit. a bit has a value of either logic 0 or logic 1.
glossary advance information 68hc(9)12d60 ? rev 3.0 420 glossary motorola branch instruction ? an instruction that causes the cpu to continue processing at a memory location other than the next sequential address. break module ? a module in the m68hc08 family. the break module allows software to halt program execution at a programmable point in order to enter a background routine. breakpoint ? a number written into the break address registers of the break module. when a number appears on the internal address bus that is the same as the number in the break address registers, the cpu executes the software interrupt instruction (swi). break interrupt ? a software interrupt caused by the appearance on the internal address bus of the same value that is written in the break address registers. bus ? a set of wires that transfers logic signals. bus clock ? the bus clock is derived from the cgmout output from the cgm. the bus clock frequency, f op , is equal to the frequency of the oscillator output, cgmxclk, divided by four. byte ? a set of eight bits. c ? the carry/borrow bit in the condition code register. the cpu08 sets the carry/borrow bit when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some logical operations and data manipulation instructions also clear or set the carry/borrow bit (as in bit test and branch instructions and shifts and rotates). ccr ? see ? condition code register. ? central processor unit (cpu) ? the primary functioning unit of any computer system. the cpu controls the execution of instructions. cgm ? see ? clock generator module (cgm). ? clear ? to change a bit from logic 1 to logic 0; the opposite of set. clock ? a square wave signal used to synchronize events in a computer. clock generator module (cgm) ? a module in the m68hc08 family. the cgm generates a base clock signal from which the system clocks are derived. the cgm may include a crystal oscillator circuit and or phase-locked loop (pll) circuit. comparator ? a device that compares the magnitude of two inputs. a digital comparator defines the equality or relative differences between two binary numbers. computer operating properly module (cop) ? a counter module in the m68hc08 family that resets the mcu if allowed to overflow.
glossary 68hc(9)12d60 ? rev 3.0 advance information motorola glossary 421 condition code register (ccr) ? an 8-bit register in the cpu08 that contains the interrupt mask bit and five bits that indicate the results of the instruction just executed. control bit ? one bit of a register manipulated by software to control the operation of the module. control unit ? one of two major units of the cpu. the control unit contains logic functions that synchronize the machine and direct various operations. the control unit decodes instructions and generates the internal control signals that perform the requested operations. the outputs of the control unit drive the execution unit, which contains the arithmetic logic unit (alu), cpu registers, and bus interface. cop ? see "computer operating properly module (cop)." counter clock ? the input clock to the tim counter. this clock is the output of the tim prescaler. cpu ? see ? central processor unit (cpu). ? cpu08 ? the central processor unit of the m68hc08 family. cpu clock ? the cpu clock is derived from the cgmout output from the cgm. the cpu clock frequency is equal to the frequency of the oscillator output, cgmxclk, divided by four. cpu cycles ? a cpu cycle is one period of the internal bus clock, normally derived by dividing a crystal oscillator source by two or more so the high and low times will be equal. the length of time required to execute an instruction is measured in cpu clock cycles. cpu registers ? memory locations that are wired directly into the cpu logic instead of being part of the addressable memory map. the cpu always has direct access to the information in these registers. the cpu registers in an m68hc08 are:  a (8-bit accumulator)  h:x (16-bit index register)  sp (16-bit stack pointer)  pc (16-bit program counter)  ccr (condition code register containing the v, h, i, n, z, and c bits) csic ? customer-specified integrated circuit cycle time ? the period of the operating frequency: t cyc =1/f op . decimal number system ? base 10 numbering system that uses the digits zero through nine.
glossary advance information 68hc(9)12d60 ? rev 3.0 422 glossary motorola direct memory access module (dma) ? a m68hc08 family module that can perform data transfers between any two cpu-addressable locations without cpu intervention. for transmitting or receiving blocks of data to or from peripherals, dma transfers are faster and more code-efficient than cpu interrupts. dma ? see "direct memory access module (dma)." dma service request ? a signal from a peripheral to the dma module that enables the dma module to transfer data. duty cycle ? a ratio of the amount of time the signal is on versus the time it is off. duty cycle is usually represented by a percentage. eeprom ? electrically erasable, programmable, read-only memory. a nonvolatile type of memory that can be electrically reprogrammed. eprom ? erasable, programmable, read-only memory. a nonvolatile type of memory that can be erased by exposure to an ultraviolet light source and then reprogrammed. exception ? an event such as an interrupt or a reset that stops the sequential execution of the instructions in the main program. external interrupt module (irq) ? a module in the m68hc08 family with both dedicated external interrupt pins and port pins that can be enabled as interrupt pins. fetch ? to copy data from a memory location into the accumulator. firmware ? instructions and data programmed into nonvolatile memory. free-running counter ? a device that counts from zero to a predetermined number, then rolls over to zero and begins counting again. full-duplex transmission ? communication on a channel in which data can be sent and received simultaneously. h ? the upper byte of the 16-bit index register (h:x) in the cpu08. h ? the half-carry bit in the condition code register of the cpu08. this bit indicates a carry from the low-order four bits of the accumulator value to the high-order four bits. the half-carry bit is required for binary-coded decimal arithmetic operations. the decimal adjust accumulator (daa) instruction uses the state of the h and c bits to determine the appropriate correction factor. hexadecimal ? base 16 numbering system that uses the digits 0 through 9 and the letters a through f. high byte ? the most significant eight bits of a word.
glossary 68hc(9)12d60 ? rev 3.0 advance information motorola glossary 423 illegal address ? an address not within the memory map illegal opcode ? a nonexistent opcode. i ? the interrupt mask bit in the condition code register of the cpu08. when i is set, all interrupts are disabled. index register (h:x) ? a 16-bit register in the cpu08. the upper byte of h:x is called h. the lower byte is called x. in the indexed addressing modes, the cpu uses the contents of h:x to determine the effective address of the operand. h:x can also serve as a temporary data storage location. input/output (i/o) ? input/output interfaces between a computer system and the external world. a cpu reads an input to sense the level of an external signal and writes to an output to change the level on an external signal. instructions ? operations that a cpu can perform. instructions are expressed by programmers as assembly language mnemonics. a cpu interprets an opcode and its associated operand(s) and instruction. interrupt ? a temporary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine. interrupt request ? a signal from a peripheral to the cpu intended to cause the cpu to execute a subroutine. i/o ? see ? input/output (i/0). ? irq ? see "external interrupt module (irq)." jitter ? short-term signal instability. latch ? a circuit that retains the voltage level (logic 1 or logic 0) written to it for as long as power is applied to the circuit. latency ? the time lag between instruction completion and data movement. least significant bit (lsb) ? the rightmost digit of a binary number. logic 1 ? a voltage level approximately equal to the input power voltage (v dd ). logic 0 ? a voltage level approximately equal to the ground voltage (v ss ). low byte ? the least significant eight bits of a word. low voltage inhibit module (lvi) ? a module in the m68hc08 family that monitors power supply voltage.
glossary advance information 68hc(9)12d60 ? rev 3.0 424 glossary motorola lvi ? see "low voltage inhibit module (lvi)." m68hc08 ? a motorola family of 8-bit mcus. mark/space ? the logic 1/logic 0 convention used in formatting data in serial communication. mask ? 1. a logic circuit that forces a bit or group of bits to a desired state. 2. a photomask used in integrated circuit fabrication to transfer an image onto silicon. mask option ? a optional microcontroller feature that the customer chooses to enable or disable. mask option register (mor) ? an eprom location containing bits that enable or disable certain mcu features. mcu ? microcontroller unit. see ? microcontroller. ? memory location ? each m68hc08 memory location holds one byte of data and has a unique address. to store information in a memory location, the cpu places the address of the location on the address bus, the data information on the data bus, and asserts the write signal. to read information from a memory location, the cpu places the address of the location on the address bus and asserts the read signal. in response to the read signal, the selected memory location places its data onto the data bus. memory map ? a pictorial representation of all memory locations in a computer system. microcontroller ? microcontroller unit (mcu). a complete computer system, including a cpu, memory, a clock oscillator, and input/output (i/o) on a single integrated circuit. modulo counter ? a counter that can be programmed to count to any number from zero to its maximum possible modulus. monitor rom ? a section of rom that can execute commands from a host computer for testing purposes. mor ? see "mask option register (mor)." most significant bit (msb) ? the leftmost digit of a binary number. multiplexer ? a device that can select one of a number of inputs and pass the logic level of that input on to the output. n ? the negative bit in the condition code register of the cpu08. the cpu sets the negative bit when an arithmetic operation, logical operation, or data manipulation produces a negative result. nibble ? a set of four bits (half of a byte).
glossary 68hc(9)12d60 ? rev 3.0 advance information motorola glossary 425 object code ? the output from an assembler or compiler that is itself executable machine code, or is suitable for processing to produce executable machine code. opcode ? a binary code that instructs the cpu to perform an operation. open-drain ? an output that has no pullup transistor. an external pullup device can be connected to the power supply to provide the logic 1 output voltage. operand ? data on which an operation is performed. usually a statement consists of an operator and an operand. for example, the operator may be an add instruction, and the operand may be the quantity to be added. oscillator ? a circuit that produces a constant frequency square wave that is used by the computer as a timing and sequencing reference. otprom ? one-time programmable read-only memory. a nonvolatile type of memory that cannot be reprogrammed. overflow ? a quantity that is too large to be contained in one byte or one word. page zero ? the first 256 bytes of memory (addresses $0000 ? $00ff). parity ? an error-checking scheme that counts the number of logic 1s in each byte transmitted. in a system that uses odd parity, every byte is expected to have an odd number of logic 1s. in an even parity system, every byte should have an even number of logic 1s. in the transmitter, a parity generator appends an extra bit to each byte to make the number of logic 1s odd for odd parity or even for even parity. a parity checker in the receiver counts the number of logic 1s in each byte. the parity checker generates an error signal if it finds a byte with an incorrect number of logic 1s. pc ? see ? program counter (pc). ? peripheral ? a circuit not under direct cpu control. phase-locked loop (pll) ? a oscillator circuit in which the frequency of the oscillator is synchronized to a reference signal. pll ? see "phase-locked loop (pll)." pointer ? pointer register. an index register is sometimes called a pointer register because its contents are used in the calculation of the address of an operand, and therefore points to the operand. polarity ? the two opposite logic levels, logic 1 and logic 0, which correspond to two different voltage levels, v dd and v ss . polling ? periodically reading a status bit to monitor the condition of a peripheral device. port ? a set of wires for communicating with off-chip devices.
glossary advance information 68hc(9)12d60 ? rev 3.0 426 glossary motorola prescaler ? a circuit that generates an output signal related to the input signal by a fractional scale factor such as 1/2, 1/8, 1/10 etc. program ? a set of computer instructions that cause a computer to perform a desired operation or operations. program counter (pc) ? a 16-bit register in the cpu08. the pc register holds the address of the next instruction or operand that the cpu will use. pull ? an instruction that copies into the accumulator the contents of a stack ram location. the stack ram address is in the stack pointer. pullup ? a transistor in the output of a logic gate that connects the output to the logic 1 voltage of the power supply. pulse-width ? the amount of time a signal is on as opposed to being in its off state. pulse-width modulation (pwm) ? controlled variation (modulation) of the pulse width of a signal with a constant frequency. push ? an instruction that copies the contents of the accumulator to the stack ram. the stack ram address is in the stack pointer. pwm period ? the time required for one complete cycle of a pwm waveform. ram ? random access memory. all ram locations can be read or written by the cpu. the contents of a ram memory location remain valid until the cpu writes a different value or until power is turned off. rc circuit ? a circuit consisting of capacitors and resistors having a defined time constant. read ? to copy the contents of a memory location to the accumulator. register ? a circuit that stores a group of bits. reserved memory location ? a memory location that is used only in special factory test modes. writing to a reserved location has no effect. reading a reserved location returns an unpredictable value. reset ? to force a device to a known condition. rom ? read-only memory. a type of memory that can be read but cannot be changed (written). the contents of rom must be specified before manufacturing the mcu. sci ? see "serial communication interface module (sci)." serial ? pertaining to sequential transmission over a single line.
glossary 68hc(9)12d60 ? rev 3.0 advance information motorola glossary 427 serial communications interface module (sci) ? a module in the m68hc08 family that supports asynchronous communication. serial peripheral interface module (spi) ? a module in the m68hc08 family that supports synchronous communication. set ? to change a bit from logic 0 to logic 1; opposite of clear. shift register ? a chain of circuits that can retain the logic levels (logic 1 or logic 0) written to them and that can shift the logic levels to the right or left through adjacent circuits in the chain. signed ? a binary number notation that accommodates both positive and negative numbers. the most significant bit is used to indicate whether the number is positive or negative, normally logic 0 for positive and logic 1 for negative. the other seven bits indicate the magnitude of the number. software ? instructions and data that control the operation of a microcontroller. software interrupt (swi) ? an instruction that causes an interrupt and its associated vector fetch. spi ? see "serial peripheral interface module (spi)." stack ? a portion of ram reserved for storage of cpu register contents and subroutine return addresses. stack pointer (sp) ? a 16-bit register in the cpu08 containing the address of the next available storage location on the stack. start bit ? a bit that signals the beginning of an asynchronous serial transmission. status bit ? a register bit that indicates the condition of a device. stop bit ? a bit that signals the end of an asynchronous serial transmission. subroutine ? a sequence of instructions to be used more than once in the course of a program. the last instruction in a subroutine is a return from subroutine (rts) instruction. at each place in the main program where the subroutine instructions are needed, a jump or branch to subroutine (jsr or bsr) instruction is used to call the subroutine. the cpu leaves the flow of the main program to execute the instructions in the subroutine. when the rts instruction is executed, the cpu returns to the main program where it left off. synchronous ? refers to logic circuits and operations that are synchronized by a common reference signal. tim ? see "timer interface module (tim)."
glossary advance information 68hc(9)12d60 ? rev 3.0 428 glossary motorola timer interface module (tim) ? a module used to relate events in a system to a point in time. timer ? a module used to relate events in a system to a point in time. toggle ? to change the state of an output from a logic 0 to a logic 1 or from a logic 1 to a logic 0. tracking mode ? mode of low-jitter pll operation during which the pll is locked on a frequency. also see "acquisition mode." two ? s complement ? a means of performing binary subtraction using addition techniques. the most significant bit of a two ? s complement number indicates the sign of the number (1 indicates negative). the two ? s complement negative of a number is obtained by inverting each bit in the number and then adding 1 to the result. unbuffered ? utilizes only one register for data; new data overwrites current data. unimplemented memory location ? a memory location that is not used. writing to an unimplemented location has no effect. reading an unimplemented location returns an unpredictable value. executing an opcode at an unimplemented location causes an illegal address reset. v ? the overflow bit in the condition code register of the cpu08. the cpu08 sets the v bit when a two's complement overflow occurs. the signed branch instructions bgt, bge, ble, and blt use the overflow bit. variable ? a value that changes during the course of program execution. vco ? see "voltage-controlled oscillator." vector ? a memory location that contains the address of the beginning of a subroutine written to service an interrupt or reset. voltage-controlled oscillator (vco) ? a circuit that produces an oscillating output signal of a frequency that is controlled by a dc voltage applied to a control input. waveform ? a graphical representation in which the amplitude of a wave is plotted against time. wired-or ? connection of circuit outputs so that if any output is high, the connection point is high. word ? a set of two bytes (16 bits). write ? the transfer of a byte of data from the cpu to a memory location. x ? the lower byte of the index register (h:x) in the cpu08. z ? the zero bit in the condition code register of the cpu08. the cpu08 sets the zero bit when an arithmetic operation, logical operation, or data manipulation produces a result of $00.
68hc(9)12d60 ? rev 3.0 advance information motorola revision history 429 advance information ? 68hc(9)12d60 revision history this section lists the revision history of the document since the first release. data for previous internal drafts is unavailable. 23.8 changes from rev 2.0 to rev 3.0 section page (in rev 3.0) description of change pinout and signal descriptions 43 c a in figure 3-5 changed to c p 45 note added about consideration of crystal selection due to emc emissions clock functions 145 note added about consideration of crystal selection due to emc emissions 149 major rewrite of limp-home and fast stop recovery modes . 167 system clock frequency formulae updated for clarification. 169 figure 12-6 modified for clarification. 172 figure 12-9 modified for clarification. mscan controller 291 first two bullets of sleep mode description updated 304 slprq = 1 description updated electrical specifications 365 sentence about preliminary status removed 369 added note about typical values for 2 and 4hz columns of table 20-4 . added note for analog supply current in table 20-5 . 370 expanded table note 3 to define conditions for accuracy testing. 372 changes to maximum eeprom erase and data retention times 374 f xtal removed 374 footnote added restricting external oscillator operating frequency to 8mhz when using a quartz crystal 386 table footnote removed from table 20-16 regarding v ddpll
revision history advance information 68hc(9)12d60 ? rev 3.0 430 revision history motorola 23.9 changes from rev 1.0 to rev 2.0 appendix: cgm practical aspects 388 added section on dc bias. 389 point 3 removed regarding high frequency resonators 392 in paragraph 2, c changed to c 0 , r changed to r 0 393 in table 21-1 in header, c changed to c 0 , r changed to r 0 extra column added for c p 394 in table 21-2 in header, c changed to c 0 , r changed to r 0 extra column added for c p 397 new bullets added section page (in rev 2.0) description of change msi 230 clarification of sp0dr register state on reset. electrical specifications 354 change to operating conditions of key wake-up table. section page (in rev 3.0) description of change

how to reach us: usa/europe/locations not listed: motorola literature distribution; p.o. box 5405, denver, colorado 80217 1-303-675-2140 or 1-800-441-2447 japan: motorola japan ltd.; sps, technical information center, 3-20-1, minami-azabu minato-ku, tokyo 106-8573 japan 81-3-3440-3569 asia/pacific: motorola semiconductors h.k. ltd.; silicon harbour centre, 2 dai king street, tai po industrial estate, tai po, n.t., hong kong 852-26668334 technical information center: 1-800-521-6274 home page: http://www.motorola.com/semiconductors information in this document is provided solely to enable system and software implementers to use motorola products. there are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. ? typical ? parameters which may be provided in motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including ? typicals ? must be validated for each customer application by customer ? s technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and the stylized m logo are registered in the u.s. patent and trademark office. digital dna is a trademark of motorola, inc. all other product or service names are the property of their respective owners. motorola, inc. is an equal opportunity/affirmative action employer. ? motorola, inc. 2002 MC68HC912D60/d


▲Up To Search▲   

 
Price & Availability of MC68HC912D60

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X